Input Box Help with Code

Give me few minutes...
 
Here's the best way I can think of doing it where you only have to have one password form - :)


(Ones 2003 & the other is 97)
 

Attachments

You ARE Amazing! I cant thank you enough, but if you woudlnt mind can I ask just one tiny more question hopefully.

The user enters a password on form "Login". The password is checked against a table "tblUsers" when a command button called "SignIn" is clicked. This then takes me to the form "Spec Form" This all works. However, at the same time the command button is clicked and takes me to "Spec Form" I am trying to have a tick box checked and locked. The tick box is called "chkapproval" and is linked to a yes/no field "chkapproval" in table "TEST PASSWORD TABLE" here is the code from the command button on click

I've isolated it, the code hangs up at Me!chkapproval = True



Private Sub SignIn_Click()
Dim User As String
Dim pass As String
User = Nz(DLookup("[username]", "tblUsers", "[username]='" & Me.UserName & "'"), "")
pass = Nz(DLookup("[password]", "tblUsers", "[password]='" & Me.Password & "'"), "")

If User = Forms!Login!UserName Then
DoCmd.Close acForm, "Login", acSaveNo
DoCmd.OpenForm "Spec Form", acNormal
Me!chkapproval = True
Me!chkapproval.Visible = True
Me!chkapproval.Locked = True
Else
MsgBox "Invalid Username/Password combination, please try again"
End If
End Sub
 
Is chkapproval on the login form or on the spec form?
 
Then maybe something like the following would work:

forms![form spec]!chkapproval = true

etc...

???
 
I did this

Forms![Spec Form]!chkapproval = True
Forms![Spec Form]!chkapproval.Visible = True
Forms![Spec Form]!chkapproval.Locked = True

Is there a way to lock the check box permanently once it has been checked by entering the password. Its locked as soon as the person enters the password and is taken to the Spec Form, but if they close out of the form and open it again, it can be unchecked...How can I prevent this?
 
I suppose you could lock it in the form OnCurrent event - ??
 

Users who are viewing this thread

Back
Top Bottom