Using Access 97.
I have a form with a combo box. I want the detail section of the form to limit records to those = to the value of the combobox or all records if no value is selected.
Here is the code I have for the afterupdate property of the combo box:
Sub Combo40_AfterUpdate()
Dim strquery As String
If Not IsNull(Me.Combo40) Then
strquery = Me.Combo40.Value
Me.Filter = "LOB = " & strquery
Me.FilterOn = True
End If
End Sub
What happens is after a selection is made in the combo box, a dialog box pops up that says "Enter Parameter Value" has the value I selected listed and then a blank to enter a value, with an Ok and Cancel button.
If I type the value selected in the box it does indeed filter my data. But is there a way to make it automatically filter the data with having to retype the combo box selection.
Thanks in advance for your assistance.
Lisa.
I have a form with a combo box. I want the detail section of the form to limit records to those = to the value of the combobox or all records if no value is selected.
Here is the code I have for the afterupdate property of the combo box:
Sub Combo40_AfterUpdate()
Dim strquery As String
If Not IsNull(Me.Combo40) Then
strquery = Me.Combo40.Value
Me.Filter = "LOB = " & strquery
Me.FilterOn = True
End If
End Sub
What happens is after a selection is made in the combo box, a dialog box pops up that says "Enter Parameter Value" has the value I selected listed and then a blank to enter a value, with an Ok and Cancel button.
If I type the value selected in the box it does indeed filter my data. But is there a way to make it automatically filter the data with having to retype the combo box selection.
Thanks in advance for your assistance.
Lisa.