J
J. B.
Hi all,
I have been trying to use VBA to filter records on a form. I keep
recieving the run time error 2001 "You have canceled the last operation".
Here is the code that I am using:
Private Sub cboCompanyName_AfterUpdate()
If IsNull(Me.cboCompanyName) Then
Me.FilterOn = False
Else
Me.Filter = "Cust_ID = """ & Me.cboCompanyName & """"
Me.FilterOn = True
End If
End Sub
I recieve the same error is I was to use this syntax:
Me.Filter = "tblCustomer.Cust_ID = """ & Me.cboCompanyName & """"
The combo box is using a query that displays the Customers Name in the first
column and is bound by the second column which is the Cust_ID value. I
don't know if this has anything to do with the error.
Any help would be much apreciated.
Thanks in advance,
J. B.
I have been trying to use VBA to filter records on a form. I keep
recieving the run time error 2001 "You have canceled the last operation".
Here is the code that I am using:
Private Sub cboCompanyName_AfterUpdate()
If IsNull(Me.cboCompanyName) Then
Me.FilterOn = False
Else
Me.Filter = "Cust_ID = """ & Me.cboCompanyName & """"
Me.FilterOn = True
End If
End Sub
I recieve the same error is I was to use this syntax:
Me.Filter = "tblCustomer.Cust_ID = """ & Me.cboCompanyName & """"
The combo box is using a query that displays the Customers Name in the first
column and is bound by the second column which is the Cust_ID value. I
don't know if this has anything to do with the error.
Any help would be much apreciated.
Thanks in advance,
J. B.