Using Msgbox to delete a record

Vaimpir

JAFO
Local time
Today, 10:00
Joined
Mar 5, 2004
Messages
78
I have searched this forum and having trouble finding what I'm looking for.

I have a form with a list box containing all information for employees:
-Name
-Email
-Password
-Security Access

If an administrator chooses an employee from the list box it populates associated textboxes on the save form. The admin has the option of updating certain fields or deleting the selected record. I have a command button that runs a delete query. I have suspended the warning messages in code on the delete button and this works fine. I want to add a msgbox to the cmdbutton to make sure the admin wanted to delete this record but I am having troubles getting it to work now.

Steven
 
How about -

Before the code execution that deletes the record -

Dim MyReply As Integer
MyReply=MsgBox("Confirm Delete? Y/N,vbYesNo,"Delete")
If MyReply=7 Then Exit Sub
.
.
.Delete Code goes here...


Does that help?

Dave E
 
No it is still not running the query.
 
I got it. I guess it's still too early for me. I left one of the fields empty that runs the query. DUH!!!

Steven
 

Users who are viewing this thread

Back
Top Bottom