I'm trying to set up a program that you need to have a user name to access. All data for the program is stored in SQL 7. This is the code so far but it doesn't seem to be authenticating the username, instead it just loads the program straight up no matter what is entered in the login screen. Here is my code so far :
Private Sub cmdLogin_Click()
Dim User As String
User = LoginScreen.UserName
UserLogin = "SELECT * FROM TBlLogin WHERE UserName = '" & User & "'"
If IsNull(UserLogin) Then
MsgBox "User does not exist!", vbCritical, "User Login"
Else: frmMainMenuScreen.Show
Unload frmLoginScreen
End If
End Sub
I think its something stupid like I'm not putting the right parenthasis in. If anyone knows how this should be written I would appreciate them saying.
Private Sub cmdLogin_Click()
Dim User As String
User = LoginScreen.UserName
UserLogin = "SELECT * FROM TBlLogin WHERE UserName = '" & User & "'"
If IsNull(UserLogin) Then
MsgBox "User does not exist!", vbCritical, "User Login"
Else: frmMainMenuScreen.Show
Unload frmLoginScreen
End If
End Sub
I think its something stupid like I'm not putting the right parenthasis in. If anyone knows how this should be written I would appreciate them saying.