DBGrid Problem Plz Help ! (1 Viewer)

n00b

Registered User.
Local time
Today, 06:08
Joined
Jan 28, 2003
Messages
12
Hello Everyone ,

I am currently making a project for a small clinic in which i have 2 DB Combos and then a DB Grid and i am not very fimiliar with this hopefully some one else here more experienced can help me out

i am stuck at the DBGrid part doing a Search and getting the grid to showing the search results .

Dim strSQL As String
Dim strAnswer As String

strAnswer = InputBox("Enter The Name of the Patient ", "Find Records")
strSQL = "Select * from Notes where [PatientName] like " & _
"'*" & strAnswer & "*'"

' run the query
Set recNotes = dbcurrent.OpenRecordset(strSQL)

If recNotes.RecordCount = 0 Then
'no records found
MsgBox "No matching records found. Displaying all records."
Set recNotes = dbcurrent.OpenRecordset("Notes")
Else
'at least one record was found
'recNotes.MoveFirst

( Part Where i Need Help) DBGrid1.SetFocus
DBGrid1.Refresh

End If
 

n00b

Registered User.
Local time
Today, 06:08
Joined
Jan 28, 2003
Messages
12
Btw this is a VB application with Access Database
 

Users who are viewing this thread

Top Bottom