Private Sub cmdfind_Click()
Dim search As String
search = txtfind.Text
Con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\HOSTEL STUDENT.mdb;Persist Security Info=False"
Rs.Open "SELECT * FROM STUDENTS WHERE [REG] LIKE" & "'" & search & "'", Con, adOpenStatic, adLockOptimistic
Do Until Rs.EOF
Rs.MoveNext
Loop
If Rs.EOF = True Or Rs.BOF = True Then
MsgBox "PLEASE REGISTER YOUR NAME TO WARDEN"
Else
txtNAME = Rs.Fields("NAME")
txtMATRIX = Rs.Fields("MATRIX NO")
txtIC = Rs.Fields("IC NO")
txtCONT = Rs.Fields("CONTACT NO")
txtROOM = Rs.Fields("ROOM NO")
End If
Rs.Close
Con.Close
End Sub
sonunclejalil 0 Newbie Poster
tinstaafl 1,176 Posting Maven
sonunclejalil 0 Newbie Poster
sonunclejalil 0 Newbie Poster
rishif2 57 Posting Whiz in Training
sonunclejalil 0 Newbie Poster
rishif2 57 Posting Whiz in Training
sonunclejalil 0 Newbie Poster
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.