I'm trying to retreive specific recods from access to vb through a connection i made; the users select from 3 choices in comboBox ("Last Name" or "Phone#" or "Genie#"
to populate the feilds. Here is my code, could somebody tell me whats wrong with it:
On Error GoTo OOPS
Dim Mystring As String
Dim mytxt As String
Screen.MousePointer = ccArrowQuestion
Mystring = "cmbfind.Text"
mytxt = "txtfind"
Data1.RecordSource = "SELECT * FROM [FOB Cutomer] WHERE Mystring = '" & mytxt & " "
Data1.Refresh
Data1.Recordset.MoveLast: Data1.Recordset.MoveFirst
MsgBox Data1.Recordset.RecordCount & " matches found."
Exit Sub
OOPS:
MsgBox "No Records Found"
End Sub
On Error GoTo OOPS
Dim Mystring As String
Dim mytxt As String
Screen.MousePointer = ccArrowQuestion
Mystring = "cmbfind.Text"
mytxt = "txtfind"
Data1.RecordSource = "SELECT * FROM [FOB Cutomer] WHERE Mystring = '" & mytxt & " "
Data1.Refresh
Data1.Recordset.MoveLast: Data1.Recordset.MoveFirst
MsgBox Data1.Recordset.RecordCount & " matches found."
Exit Sub
OOPS:
MsgBox "No Records Found"
End Sub