Trying to create a simple login but having problems with it running (high lighted in red) anyone any ideas i have crecked i have all the right names ect but cant see the problem
Please help
Option Compare Database
Private Sub cmdCancel_Click()
If MsgBox("Are you sure you want to cancel?" & vbCrLf & _
"If you cancel the database will close", vbQuestion + vbYesNo, "Cancel Confirmation") = vbYes Then
DoCmd.Quit
End If
End Sub
Private Sub cmdOK_Click()
Dim strUser As String
Dim strPWD As String
Dim intUSL As Integer
strUser = Me.txtUser
If DCount("[UserPWD]", "tblUsers", "[UserName]='" & Me.txtUser & "'") > 0 Then
strPWD = DLookup("[UserPWD]", "tblUsers", "[UserName]='" & Me.txtUser & "'")
If strPWD = Me.txtPWD Then
intUSL = DLookup("[SecurityGroup]", "tblUsers", "[UserName]='" & Me.txtUser & "'")
Forms!frmUSL.txtUN = strUser
Forms!frmUSL.txtUSL = intUSL
Select Case intUSL
Case 1
DoCmd.OpenForm "2014 Accounts Tracker Main Data", acNormal
Case 2
DoCmd.OpenForm "frmTestData", acNormal, , , acFormReadOnly
Case 3
MsgBox "Not configured yet", vbExclamation, "Not configured"
Case 4
MsgBox "Not configured yet", vbExclamation, "Not configured"
End Select
DoCmd.Close acForm, "frmTestLogin", acSaveNo
End If
End If
End Sub
Private Sub Cancel_Click()
End Sub
Private Sub Login_Click()
End Sub
Please help
Option Compare Database
Private Sub cmdCancel_Click()
If MsgBox("Are you sure you want to cancel?" & vbCrLf & _
"If you cancel the database will close", vbQuestion + vbYesNo, "Cancel Confirmation") = vbYes Then
DoCmd.Quit
End If
End Sub
Private Sub cmdOK_Click()
Dim strUser As String
Dim strPWD As String
Dim intUSL As Integer
strUser = Me.txtUser
If DCount("[UserPWD]", "tblUsers", "[UserName]='" & Me.txtUser & "'") > 0 Then
strPWD = DLookup("[UserPWD]", "tblUsers", "[UserName]='" & Me.txtUser & "'")
If strPWD = Me.txtPWD Then
intUSL = DLookup("[SecurityGroup]", "tblUsers", "[UserName]='" & Me.txtUser & "'")
Forms!frmUSL.txtUN = strUser
Forms!frmUSL.txtUSL = intUSL
Select Case intUSL
Case 1
DoCmd.OpenForm "2014 Accounts Tracker Main Data", acNormal
Case 2
DoCmd.OpenForm "frmTestData", acNormal, , , acFormReadOnly
Case 3
MsgBox "Not configured yet", vbExclamation, "Not configured"
Case 4
MsgBox "Not configured yet", vbExclamation, "Not configured"
End Select
DoCmd.Close acForm, "frmTestLogin", acSaveNo
End If
End If
End Sub
Private Sub Cancel_Click()
End Sub
Private Sub Login_Click()
End Sub