View Full Version : PopUp Form To Delete Records!


pcdummy
07-27-2001, 03:17 PM
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
07-28-2001, 08:33 AM
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 http://www.access-programmers.co.uk/ubb/smile.gif

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