By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,486 Members | 2,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,486 IT Pros & Developers. It's quick & easy.

Clear password from form

P: 18
I'v got a form thats going to delete a bunch of stuff but I want it pw protected so I created a in-between form asking for a pw. But I cant get the PW to be blank when I open the form. I have a table with PW and PW Entered where PW is the correct and PW Entered is the users pw. If it's correct then it goes ahead and opens the correct form but if it's incorrect it closes just like it's supposed to. But after all is said and done the next time I open the in-between form the PW is still there whether correct or incorrect. I just need it to be gone everytime. any suggestions are great..... thanks.




Private Sub Command5_Click()
If Me.Entered_Password = Me.Password Then
DoCmd.OpenForm "ResetDaysWork", acNormal, , , acFormEdit, acWindowNormal
DoCmd.Close acForm, "OpenReset", acSaveNo
Else
DoCmd.Close acForm, "OpenReset", acSaveNo

End If
End Sub.
Jul 26 '07 #1
Share this Question
Share on Google+
5 Replies


Rabbit
Expert Mod 10K+
P: 12,315
Normally you don't bind the table to the password form.
Usually it's unbound and you merely check the password against the value in the table.
Jul 26 '07 #2

P: 18
Can you please explain in a little more detail? I'm a self taughter...

What if my table contained ONLY the PW and the field on the form was a text box...

Private Sub Command5_Click()
If Me.Password = [Tables]![ResetPW]![Password] Then
DoCmd.OpenForm "ResetDaysWork", acNormal, , , acFormEdit, acWindowNormal
DoCmd.Close acForm, "OpenReset", acSaveNo
'DoCmd.OpenQuery "ClearEnteredPW", acViewNormal, acReadOnly
Else
DoCmd.Close acForm, "OpenReset", acSaveNo

End If
End Sub

But I don't think the [Tables]![ResetPW]![Password] is right.. it's saying It cant find the field 'Tables'
Jul 26 '07 #3

Rabbit
Expert Mod 10K+
P: 12,315
You can't refer to the values in a table using Tables!TableName!FieldName
You have to use DLookup("FieldName", "TableName", "Optional Where Clause")
Jul 26 '07 #4

P: 18
Thanks a million.... I got it going now.... Ya'll are the best..
Jul 26 '07 #5

Rabbit
Expert Mod 10K+
P: 12,315
Not a problem, good luck.
Jul 26 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.