I have a form with a button which then shows a popup form. The popup form is just to list customers and their respective customer numbers and is not relevant to the base form that the button resides on (as in there is no common data).
When the popup form loads it has a textbox where the user can enter part of the customer name and click search and I want the popup form to filter on text that appears in that textbox.
The name of the field it will filter on is CUSTOMER_NAME and the name of the textbox for user entry is CUST_SEARCH.
I have tried various combinations of code that I have found from forums but, although the 'filtered' option is highlighted at the bottom of the popup form nothing is actually showing (which doesn't happen when you type the same text in to the search box). It says on the filter box "click to filter the records by using the last saved filter" so it looks like I have to save a filter somewhere to be able to apply.
My current code is (and the variable does set correctly to the entry in the textbox when I debug):
Me.CUST_SEARCH.SetFocus
Dim str1 As String
str1 = "CUSTOMER_NAME Like '" + Me.CUST_SEARCH.Text + "'"
Me.CUST_SEARCH.SetFocus
Me.Form.Filter = str1
Me.Form.FilterOn = True
Any help would be greatly appreciated.
When the popup form loads it has a textbox where the user can enter part of the customer name and click search and I want the popup form to filter on text that appears in that textbox.
The name of the field it will filter on is CUSTOMER_NAME and the name of the textbox for user entry is CUST_SEARCH.
I have tried various combinations of code that I have found from forums but, although the 'filtered' option is highlighted at the bottom of the popup form nothing is actually showing (which doesn't happen when you type the same text in to the search box). It says on the filter box "click to filter the records by using the last saved filter" so it looks like I have to save a filter somewhere to be able to apply.
My current code is (and the variable does set correctly to the entry in the textbox when I debug):
Me.CUST_SEARCH.SetFocus
Dim str1 As String
str1 = "CUSTOMER_NAME Like '" + Me.CUST_SEARCH.Text + "'"
Me.CUST_SEARCH.SetFocus
Me.Form.Filter = str1
Me.Form.FilterOn = True
Any help would be greatly appreciated.