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!

Delete Routine Code on Form

Status
Not open for further replies.

judyscofield

Programmer
Sep 24, 2001
56
US
I'm a long time FoxPro programmer, fairly new to Access and need some help.

I placed a delete button on a codes tables maintenance form using the button wizard and it createdthe following code:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

I would like to code some activity if the user chooses yes to the delete messagebox, but not if they choose no. How can I tell what they have chosen, or is there another way to handle this? The user wants to delete the particular code in related tables if the code is deleted (just leaving it blank), but not delete the whole related record.

Thanks for the help.

Judy Scofield
 
Hi Judy!

Try the following code:

If MsgBox("YourMessage", vbYesNo + vbQuestion, "YourTitle") = vbYes Then
Put your code for the yes button here
Else
Put your code for the no button here
End If

hth
Jeff Bridgham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top