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

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 ').

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.