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