David Ball
Registered User.
- Local time
- Today, 12:32
- Joined
- Aug 9, 2010
- Messages
- 230
Hi,
I have a query, qryCC_Data, that I can open from a command button on a form using the code below in the command button’s on-click event.
Private Sub Command7_Click()
DoCmd.OpenQuery "qryCC_Data", , acReadOnly
End Sub
I also have a listbox on the form, List5, and would like to be able to select a value from the listbox and have it filter the query when I run it.
The name of the field in the qryCC_Data that corresponds to the value I would select from the listbox is Zone.
I have tried modifying my code to do this filter but can't get it working.
What does my code need to be?
Thanks very much
Dave
I have a query, qryCC_Data, that I can open from a command button on a form using the code below in the command button’s on-click event.
Code:
DoCmd.OpenQuery "qryCC_Data", , acReadOnly
End Sub
Code:
I also have a listbox on the form, List5, and would like to be able to select a value from the listbox and have it filter the query when I run it.
The name of the field in the qryCC_Data that corresponds to the value I would select from the listbox is Zone.
I have tried modifying my code to do this filter but can't get it working.
What does my code need to be?
Thanks very much
Dave