Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple SQL question....

Status
Not open for further replies.

Skinsella

Programmer
Feb 20, 2001
23
GB
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top