Good day everyone.
Used a code for a login form and it doesn't seem to be computing whatsoever.
The following is highlighted in yellow
This is in red
Any ideas?
Used a code for a login form and it doesn't seem to be computing whatsoever.
Code:
Private Sub cmdContinue_Click()
On Error GoTo ErrHandler
Dim strSQL As String
If Nz(Me.txtFirstName, "") = "" Then
MsgBox ("First Name cannot be empty.")
DoCmd.GoToControl "txtFirstName"
Exit Sub
End If
If Nz(Me.txtLastName, "") = "" Then
MsgBox ("Last Name cannot be empty.")
DoCmd.GoToControl "txtLastName"
Exit Sub
End If
If Nz(Me.txteMail, "") = "" Then
MsgBox ("Email cannot be empty.")
DoCmd.GoToControl "txteMail"
Exit Sub
End If
DoCmd.SetWarnings False
strSQL = "INSERT INTO tblUsers ( uNetworkID, uFirstName, uLastName, ueMail, uLastLogon, uLogonCount, uSecurityID, uActive )" & _
" SELECT Environ("UserName"), '" & Me.txtFirstName & "', '" & Me.txtLastName & "', '" & Me.txteMail & "', Now(), 1, 9, True"
DoCmd.RunSQL strSQL
Forms(" frmMainMenu ").Tag = "Continue" 'frmMainMenu change to the name of your Main Menu/Switchboard/Navigation Form
DoCmd.Close acForm, Me.Name
Complete:
Exit Sub
ErrHandler:
MsgBox ("Error creating user profile: " & Err.Description)
End Sub
The following is highlighted in yellow
Code:
Private Sub cmdContinue_Click()
This is in red
Code:
strSQL = "INSERT INTO tblUsers ( uNetworkID, uFirstName, uLastName, ueMail, uLastLogon, uLogonCount, uSecurityID, uActive )" & _
" SELECT Environ("UserName"), '" & Me.txtFirstName & "', '" & Me.txtLastName & "', '" & Me.txteMail & "', Now(), 1, 9, True"
Any ideas?