passwords

  • Thread starter Thread starter doug
  • Start date Start date
D

doug

in access 97 can how do i set certain forms with a
password so that only people with that password can open
the form?

thanks
doug
 
Greetings Doug,

On the Open event of the Form add a Input Box which will
prompt to enter the password and hardcode the password in
the Form .
If the Input box matches the hardcoded password then the
form is loaded Else Unload the Form.

Sample Code:
===============
Private Sub Form_Open(Cancel As Integer)
Dim str As String
str = InputBox("Enter a password")
If str = "ABC" Then
MsgBox "Hi"
Else
DoCmd.Close

End If
End Sub
===============
Best Regards

Bharat Iyengar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top