PopUp Form To Delete Records! (1 Viewer)

pcdummy

Registered User.
Local time
Today, 07:57
Joined
May 9, 2001
Messages
45
Hi Guys.. Little Stumped here.. Here is what i need. I have a form with a command button to delete the current record.. That is simple enoungh.. However,, i need this

I can create a message box that asks the user to confirm deletion... yes or no.. again easy enough... Now what i need is a pop up form that asks for a password then upon correct entry of the password deletes the current record in the main form.. i can code the password portion fine.. just need to know code to delete the current record in the main form... Does this make since..

Thanks

JEff
 

pcs

Registered User.
Local time
Today, 01:57
Joined
May 19, 2001
Messages
398
in a97 the command button wizard will build delete record code like this:

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

of course the help file says this has been replaced by RunCommand


my preference is to create a delete query that refs the current record number on my main form, then execute it in the on click event of the command button:

Dim stDocName As String

stDocName = "qryDeleteCurrentRecord"
DoCmd.OpenQuery stDocName, acNormal, acEdit

you might also want to consider putting the password entry on the main form and disable the command button until the password is entered (saves making the pop-up.

lots of other ways to do this

hth,
al
 

Users who are viewing this thread

Top Bottom