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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

password filter from command button

Status
Not open for further replies.

shy216

Programmer
Jul 21, 2005
142
US
Im not sure if this is possible in Access but...
From FormA, if user clicks command button,
a pop up will show up and ask for password.
if true, then open FormB, if false, retry or close.
is that possible?
 
the button on formA would open a popup form with a textbox for the user to enter a password. you could store the password in a table and then use dlookup in the after update of the textbox to check if the values are equal, if so, then open formb.
or you could probably just have an inputbox pop open when the button is clicked that gets the password. then have the code compare that to whatever value before opening the form.
i think the first option is more along the lines of what you want.
 
i see. thank you. can you help me with dlookup function tho? not so familiar with that yet.
 
i'm not too great with it but...
dlookup("field name", "table or query name with that field")
like if i have a table named clients and a field named lname, i would do dlookup("lname","clients")
 
Private Sub password_AfterUpdate()

=DLookUp("[password]","tblpasswordMonitor","[password]=forms!frm_pwMonitor![txtpassword]")

End Sub

it says compile error
 
try this:
Private Sub password_AfterUpdate()

If (DLookUp("[password]","tblpasswordMonitor") = forms!frm_pwMonitor![txtpassword])Then
DoCmd.OpenForm ....
Else
...
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top