Ryanh63
06-11-2008, 10:15 AM
Hiya i need help!
I am a student doin A Level ICT and my Coursework invovles databases and i need to create modules.
I am trying to create a simple password system where it looks up a table of authorised passwords. I have one table named tblpassword and a form names frmopenpassword with a text box to enter the password and an accept commnad button to be pressed when the password has been entered. Here is the code i have but i keep getting an error about a missing operator or function.
Heres the code:
Private Sub Command2_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Select * From TblPassword WHERE Password '" & Text0.Value & "'")
If rs.EOF Then
MsgBox ("Access Denied")
Else
Form_Switchboard.SetFocus
DoCard.Close acForm, "frmopenpassword"
End If
End Sub
Thank you
Ryan
I am a student doin A Level ICT and my Coursework invovles databases and i need to create modules.
I am trying to create a simple password system where it looks up a table of authorised passwords. I have one table named tblpassword and a form names frmopenpassword with a text box to enter the password and an accept commnad button to be pressed when the password has been entered. Here is the code i have but i keep getting an error about a missing operator or function.
Heres the code:
Private Sub Command2_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Select * From TblPassword WHERE Password '" & Text0.Value & "'")
If rs.EOF Then
MsgBox ("Access Denied")
Else
Form_Switchboard.SetFocus
DoCard.Close acForm, "frmopenpassword"
End If
End Sub
Thank you
Ryan