0

i got a problem where i want use 2 form which form 1 is to find info in database and form 2 for show the data but when i use call form 2, the pop up appear as invalid
below is my coding

Private Sub cmdFind_Click()
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Fairus\Documents\docklet\my work\project\HOSTEL STUDENT.mdb;Mode=Read;Persist Security Info=False"
con.Open

With rs
    .ActiveConnection = con
    .CursorType = adOpenDynamic
    .CursorLocation = adUseClient
    .LockType = adLockOptimistic
    .Open "SELECT * FROM STUDENTS where [RED ID] like" & "'" & txtScanning.Text & "'", con, adOpenStatic, adLockOptimistic
End With

If rs.EOF = True Or rs.BOF = True Then
    MsgBox "Your Name Is Not In Data"
        Else
        Call StudentInformation

End Sub
2
Contributors
1
Reply
20
Views
3 Years
Discussion Span
Last Post by GhostWolf
0

Although I've never opened a recordset they way you're doing, I do see a problem in your Select statement: there's no white-space between LIKE and the opening delimiter, (i.e. LIKE' instead of LIKE ').

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.