hi.im facing an error that says 'syntax error in FROM clause'.i dont know where i went wrong because it used to run smoothly.from my research about this error,it seems each solution is unique,it doesnt relate to what im doing.can anyone please help?here are my codes:
Private Sub Cmd_Login_Click()
Adodc1.RecordSource = "SELECT * FROM User Where user_name='" & Txt_Name.Text & "'"
Adodc1.Recordset.Requery
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then 'user doesnt exist
MsgBox "Bad Username! Try again."
Exit Sub 'so that it won't move on checking the password
End If
'user exist,check password
If Adodc1.Recordset.Fields("password") = Txt_Pass.Text Then
If Adodc1.Recordset.Fields("user_status") = "admin" Then 'check user status
'current_user = Adodc1.Recordset.Fields("user_name").Value
MsgBox "Login Successful!"
Unload Me
A2_AdminMain.Show 'login Admin Page
Else
current_user = Adodc1.Recordset.Fields("user_name").Value
MsgBox "Login Successful!"
Unload Me
A2_UserMain.Show 'login user page
End If
Else 'Wrong Password
MsgBox "Wrong password. Try again."
End If
End Sub