Hi guy, I was wondering if anyone can help me as this is driving me nuts and I'm sure I will be so simple.
I have a login in screen which is used to verify users details stored in the table T_User_Information.
Once the User has been verified I want a form (F_User_Profile) to appear so they can rank their progress towards a number of statements and populate a table T_S1PSE_T1.
At the moment, the user details are verified using the following code:
Private Sub btnSearch_Click()
Dim sUserName As String
Dim sPassword As String
sUserName = Me.txtUserName
sPassword = Me.txtPassword
If DCount("*", "T_User_Information", "UserName = '" & sUserName & "' And Password = '" & sPassword & "'") = 0 Then
MsgBox "Fail", vbExclamation, ""
Else
DoCmd.OpenForm "F_User_Profile"
End If
End Sub
and the form F_User_Profile will open.
However, the form displays ever record stored in T_User_Information. I want the form to go straight to the specific user's form so they don't have to click on the record arrows at the bottom of the form to locate their specific details.
I've tried to use the wherecondition related to open form
DoCmd.OpenForm "F_User_Profile", , , "First Name = '" & Me.txtFirstName & "'"
but I just keep getting an error 3075.
Any ideas what I’m doing wrong anyone?????
Regards
Macftm