I am getting a runtime error when I try to refresh my datasource. I am connecting to a simple Access database and trying to select all customers with a certain ID. It does that fine but it gives me a runtime error on the data refresh. can anyone help...
Private Sub cmdSubmit_Click()
Dim pstrSQL As String
If txtUserEnteredID.Text <> "" Then
pstrSQL = "SELECT * From tblCustomer " & _
" Where fldCustomerID = " & txtUserEnteredID.Text
datMentor.RecordSource = pstrSQL
datMentor.Refresh
datMentor.Visible = True
End If
End Sub
Private Sub cmdSubmit_Click()
Dim pstrSQL As String
If txtUserEnteredID.Text <> "" Then
pstrSQL = "SELECT * From tblCustomer " & _
" Where fldCustomerID = " & txtUserEnteredID.Text
datMentor.RecordSource = pstrSQL
datMentor.Refresh
datMentor.Visible = True
End If
End Sub