Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Deleting records difficulty

Status
Not open for further replies.

Compuboy

Programmer
Jun 8, 2004
38
US
I put in a button to delete the current record. I also put in some code by myself in the function. My question is when you click on delete a record, a pop up box comes up asking you if you want to delete it. If you click yes, then my code works perfectly. However, if you click no...it still works which is bad. Do you know how I could use an if statement or something to fix this?
 
If you want to control the execution of your own code at the same time then :-

DoCmd.SetWarnings False
DoCmd.OpenForm "MyCustomDialog",,,,,acDialog
If gblnContinue Then
Delete Record
' other okay code in here
Else
' not okay code in here
End If
DoCmd.SetWarnings True


Where you create your own custom pop-up form with yes/no buttons and use them to set gblnContinue


'ope-that-'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 

or

if msgbox("do you want to delete",vbokcancel)=vbOK then
'delete record function
end if

(I think i missed a couple of arguments in the msgbox, but you get the idea)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top