Purchase order setup problem

The easiest way is to create two forms, one for the MD with the authorisation field showing, and one for the plebs without.
 
i now have table with the two different names of people who can access forms etc and their passwords , how do i create a form so that they have to fill in the name and password and only if its correct they can open another form?
 
Firstly you do not need a table. You need a form with a single text box on it that has a password format. It also needs a button. After the person has entered their password they click the button. The on click property of the button has the following code.




If NameOfTextBox = "password1" Then
DoCmd.OpenForm "frm_One", acNormal, , , acFormEdit
DoCmd.Maximize
DoCmd.Close acForm, "Name of Password Form"
ElseIf NameOfTextBox = "password2" Then
DoCmd.OpenForm "frm_Two", acNormal, , , acFormEdit
DoCmd.Maximize
DoCmd.Close acForm, "frm_Pass3"

Else
DoCmd.Close acForm, "Name of Password Form"
End If


Frm_One is the form that the MD authorises the PO.
Frm_Two is another form that somebody else sees

You can repeat the elseIf part of the statement as many times as you like giving different forms opening. Note that the mode of opening is Edit Mode as set by the code. You can of course change this as you wish.

After each form is opened the password form is closed do when they close their "special" form they are outside of the protected area and must re-enter their password to get back to their form.

Neil.

Any riders you would like to add. This is a way I have been using but would welcome comments. Usually tied up with either Access security or disabling of F11 and shift key together with custom toolbar that does not allow design mode

Len
 
Since I'm an auditor by training, I don't like embedded passwords. I much prefer that users are free to set their own passwords so I would hold these in a table.

However, I think we're in the stage of crawling before you walk so I would agree that your suggestion is a good first step.

Just to expand your comment for daneo2k3:
The approach suggested works fine. The trouble is that if you allow users to see the tables directly, or you allow them to enter design mode, they can bypass the security. It is possible to hide the database design window and to disable the tool bars so this can't happen. I would leave this until everything is working, otherwise you can lock yourself out!
 

Users who are viewing this thread

Back
Top Bottom