Easy one - but I'm stuck.
I have a form with a bunch of fields and the embedded Access filter function will not work well for the user, so I need some text boxes for the user to enter variables which will filter the form.
To use on field as the example:
1) The unbound text box where the user will enter a numeric variable = "PriceDietzUpFilter"
2) The field on the form that I want the "PriceDietzUpFilter" to filter = "PriceVsDietz"
3) Both of the fields above are on the same form, named "MasterRecon"
If blank I want the filter off, of course.
Here is the mess I have now, in the After Update event. It errors on the line noted below.
I will eventually apply this filter logic to a number of fields on the form, but if I can get this one to work I can figure out the others. If there are any differences between filtering numbers or text please let me know.
I'm not a programmer (as you can see) so if you could be so kind to give the entire block of code that would be great.
I have a form with a bunch of fields and the embedded Access filter function will not work well for the user, so I need some text boxes for the user to enter variables which will filter the form.
To use on field as the example:
1) The unbound text box where the user will enter a numeric variable = "PriceDietzUpFilter"
2) The field on the form that I want the "PriceDietzUpFilter" to filter = "PriceVsDietz"
3) Both of the fields above are on the same form, named "MasterRecon"
If blank I want the filter off, of course.
Here is the mess I have now, in the After Update event. It errors on the line noted below.
Code:
Private Sub PriceDietzUpFilter_AfterUpdate()
If Len(Me.PriceDietzUpFilter) not 0 Then
Me.FilterOn = True
Me.Filter = "PriceVsDietz '" & Me.PriceDietzUpFilter & "'" (ERROR)
Else
Me.FilterOn = False
Me.Filter = ""
End If
I will eventually apply this filter logic to a number of fields on the form, but if I can get this one to work I can figure out the others. If there are any differences between filtering numbers or text please let me know.
I'm not a programmer (as you can see) so if you could be so kind to give the entire block of code that would be great.
Last edited by a moderator: