Connecting Tech Pros Worldwide Forums | Help | Site Map

How to generate Query Fields from list box selection

Newbie
 
Join Date: Dec 2008
Posts: 2
#1: Dec 4 '08
Hi

I am constructing an Access Database to produce traffic flow information to validate a traffic model.
I want to have the functionality to select time periods from a list box on a form and then have these applied to a query as the field headings so that the flow data can be outputted for only the specified time periods.

I.e. The user would select one or more time periods from the list box (e.g. 24 Hour flow, 18 Hour flow and 12 Hour flow) then click the command button to apply the selection. The selections would then transfer to the query and list all of the 24 Hour, 18 Hour and 12 Hour flows for all roads in the master table.

I assume this would require some VBA coding, which a have very limited knowledge of.

Thanks in advance
Regards
Mark
beacon's Avatar
Needs Regular Fix
 
Join Date: Aug 2007
Posts: 279
#2: Dec 4 '08

re: How to generate Query Fields from list box selection


Are you wanting to display the query results so the end user can make additional changes to the values or is this going to be used as a reporting tool?

If you need the query results, you might be interested in learning how to create custom parameter boxes so you can place your list box there. If not, the same idea applies and can be added on a form. You could set it up that when the user selects the item in the list box, the event automatically jumps you to the query, but that's all preference.

I learned how to do the custom parameter boxes on the following website and if I remember correctly it requires little to no VBA knowledge. Just some basic SQL...

Access Tips: Custom Parameter Dialogs

Let me know how it turns out for you or if there's anything else we can do to help.
Expert
 
Join Date: Jul 2008
Location: Maryland
Posts: 1,164
#3: Dec 4 '08

re: How to generate Query Fields from list box selection


That is an excellent tutorial. Thanks for the link beacon.
Reply