Popup Form to Delete Record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a form that has a command button that opens a custom popup password
form. I wish to have the user enter in a password that will allow them to
delete the record on the form below when the type in the correct password.

Thanks,
D.
 
You can create a small, unbound form.

Put a text box on the form, and set its Input Mask property to:
Password

Provide Ok and Cancel buttons on this form.

In the Click event procedure of your Ok button, check the password is
correct.
 
Hello,

I've done all that. What I was looking for is to delete the record on the
form behind the unbound form. If I write code to delete, it thinks I want to
delete a recond on the unbound form and not the form from which I opened the
unbound form.

Thanks,
D.
 
The other form does not have focus, but you can still delete the record from
the RecordsetClone of the form.

This kind of thing:

Dim rs As DAO.Recordset
With Forms("NameOfYourOtherFormHere")
If .Dirty Then
.Undo
End If
If Not .NewRecord Then
Set rs = .RecordsetClone
rs.Bookmark = .Bookmark
.Delete
End If
End With
 
Thanks Allen, that did the trick. I just had to fix the line with .Delete to
rs.Delete.

Thanks again!

D.
 
Back
Top