hi i cant seem to make the search code for my program work . . how is this so . .? this is my code:
Private Sub cmdSearch_Click()
With Adodc1
.RecordSource = "Select * from PATIENT where Last Name='" & txtSearch.Text & "'"
If .Recordset.RecordCount = 0 Then
MsgBox "No record found!", vbOKOnly + vbCritical, "Medical Record System"
txtSearch.Text = ""
txtSearch.SetFocus
End If
If txtSearch.Text = "" Then
Set Me.DataGrid1.DataSource = Adodc1
Else
Set rs = New ADODB.Recordset
rs.Open "Select * from PATIENT where Last Name=" & txtSearch.Text & ""
Set rptRecord.DataSource = rs
rptRecord.Show vbModal
Set rs = Nothing
End If
Set Me.DataGrid1.DataSource = Adodc1
End With
End Sub