AmatuerAtBest
Technical User
I am trying to do a search in access. My code is as follows
Private Sub Command348_Click()
Dim sString As double
On Error GoTo Command348_Err
Me.OrderByOn = False
Me.OrderBy = "Invoice #"
Me.OrderByOn = True
Me.FilterOn = False
sString = Me.Text345
Me.Filter = "[Invoice #]= sString"
Me.FilterOn = True
Command348_Exit:
Exit Sub
Command348_Err:
MsgBox Err.Description, vbOKOnly, "Search"
Resume Command348_Exit
End Sub
This however, give me the error of 'you canceled the previous operation'
This code works if Invoice # is a text instead of a number, as I used this code for another search.
Any ideas?
Private Sub Command348_Click()
Dim sString As double
On Error GoTo Command348_Err
Me.OrderByOn = False
Me.OrderBy = "Invoice #"
Me.OrderByOn = True
Me.FilterOn = False
sString = Me.Text345
Me.Filter = "[Invoice #]= sString"
Me.FilterOn = True
Command348_Exit:
Exit Sub
Command348_Err:
MsgBox Err.Description, vbOKOnly, "Search"
Resume Command348_Exit
End Sub
This however, give me the error of 'you canceled the previous operation'
This code works if Invoice # is a text instead of a number, as I used this code for another search.
Any ideas?