Event Procedure on a Command Button

G

Guest

Two question. I need the Opening sheet to close when the password is correct and the Main form appears. Secondly, in my input box, 123 appears. How do I prevent that from happening and say only astericks appear

Thanks
Fran

Private Sub Command1_Click(

Dim strPassw

strPasswd = InputBox("Please Enter Password", "Restricted Form"

'See if a valid entry made to input box, or i

If strPasswd = "" Or strPasswd = Empty The
MsgBox "No Input Provided", vbInformation, "Required Data
Exit Su
End I

'correct password is entered open Main form Close, Opening Shee

If strPasswd = "123" The
DoCmd.OpenForm "Main Form", acNorma
Els
MsgBox "Sorry, you do not have access to this form", vbOKOnly, "Important Information
Exit Su
End I
End Sub
 
J

Jeff Boyce

Frank

You can add code after you open the Main form to close the current form.

You can change the format of the control into which you type the password to
"Password".
 

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

Top