please help me I'm having error in rs.Open "SELECT * FROM [tbladmin] WHERE [username]= '" & txtUsername.Text & "'", con, adOpenStatic, adLockOptimistic I think my code is right I dunno where I went wrong.
Dim strUserName As String, strPassword As String
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub cmdlogin_Click()
OpenCon
rs.Open "SELECT * FROM [tbladmin] WHERE [username]= '" & txtUsername.Text & "'", con, adOpenStatic, adLockOptimistic
If rs.RecordCount <> 0 Then
If rs![Password] = txtPassword.Text Then
If rs![user_type] = "Principal" Then
MsgBox "The Principal has login", vbOKOnly + vbInformation, "LOGIN"
frmMain.Transaction.Visible = True
frmMain.Maintenance.Visible = True
frmMain.Reports.Visible = True
frmMain.Exit.Visible = True
frmMain.Others.Visible = True
frmMain.Files.Visible = True
Login1 = 1
'frmMain.Text3 = Text1.Text
'frmMain.Text4 = TimeValue(Now)
End If
End If
End If
End Sub