password between forms

colkas

Registered User.
Local time
Today, 21:40
Joined
Apr 12, 2011
Messages
128
Hi

if we have a main menu with 3 buttons

Quote
Sales
Invoice

Is it possible to have some way of blocking a user to access a form OR password the form before it opens.

I have a login form for tha database, but this purely to gain access to the database and then log who is netering a quote etc......

I dont want all users to ahve access to invoicing for example.

Any ideas please
 
At it's simplest:

Code:
If InputBox("Enter password") = "password" Then
  DoCmd.OpenForm...
Else
  Msgbox "Wrong password"
End If

Though any password scheme can probably be gotten around by a knowledgeable user.
 
Hi
Thanks for the reply. I think I understand you, so the logical way would be

Menu - on click of Invoices
1. Close menu form
2. Open password form thats as pasword text box onit (this is the bit I am not sure on and how to do it)
3. If password is correct then open invoice form
4. If not correct a message box saying incorrect password

Thanks
 
Not sure I'd close the menu form right off, but basically yes. I often use this technique to grab passwords:

http://www.baldyweb.com/WrappedForm.htm

And I generally use a global constant for the password. Overall it looks like this:

Code:
  Dim strPassword   As String

  DoCmd.OpenForm "frmPassword", WindowMode:=acDialog
  strPassword = Forms!frmPassword.txtPassword & vbNullString
  DoCmd.Close acForm, "frmPassword"

  If strPassword = gstrMaintPassword Then
    DoCmd.OpenForm...
  Else
    MsgBox "Incorrect password"
  End If
 

Users who are viewing this thread

Back
Top Bottom