Command Button

hmongie

Registered User.
Local time
Today, 16:58
Joined
May 17, 2003
Messages
99
Does anyone knows how I can put a password on a command button? What I would like to do is place a password on a command button. For example, to access a particular switchboard page, the user clicks on the command button on the front switchboard page and a popup will ask for a password. If the wrong password is typed in a prompt will let the user know that the wrong password was entered else if the right password is entered, the user will be directed to the particular switchboard.

If anyone can help me code this project.. please post...


thanks...
 
u can use something like this in the onClick event of the command button...

Code:
If InputBox("Enter Password?", "") = "myPass" Then
    doCmd.openForm "myForm"
    ...
Else
    msgbox "Incorrect Password!"
End If
 
Hey thanks.

I am only having one problem now. I want it to open another switchboard. How can I change it so that I can open another switch board page instead of a form?
 
hmongie said:
Does anyone knows how I can put a password on a command button? What I would like to do is place a password on a command button.

:p

Anyway, a switchboard is a form.

If you mean something else then use the Intellisense to display all things that can be opened with the DoCmd command

i.e

DoCmd.OpenQuery
DoCmd.OpenDataAccesspage, etc
 
It's still not working. This is what I have.

............

If InputBox("Enter Password?", "") = "myPass" Then
doCmd.openForm "Evaluations"
Else
msgbox "Incorrect Password!"
End If
................

"Evaluations" is a switchboard page. It has options that shows records.

This is the error that I get.

..............
Microsoft Visual Basic
Run-time error '2102':
The form name 'Evaluations' is misspelled or refers to a form that doesn't exist.
...................

Can anyone help...?
 
As it says, you have either mispelled the name of your switchboard or perhaps u are confusing it with somthing else?

In your database window look for your switchboard under the forms tab...
 
There is only one switch board located under my forms. The other switchboard pages are not there. Do you know where I can find them or the name that I can input them as?
 

Users who are viewing this thread

Back
Top Bottom