Create Query using value from Combobox

mrszw

Registered User.
Local time
Today, 15:13
Joined
Apr 9, 2009
Messages
11
Hi, i have been doing the following function all along using excel VBA, however, the data is getting too large, and i'm now trying to shift it into a access database environment. However, i am having some trouble and would appreciate some help and feedbacks on the viability of this in access.

Basically i would like to create a query whose data is dependent on a combobox value selected.

Sample Raw Data


Using a form with a combobox
Example, if i were to select "Jun", when i click on the "Initialize" button, i will be able to create a query the grabs the fields from Jan to Jun.


Example Result desired


I have attached a database as well.
 

Attachments

Have a search on "Search form" in the reference forum.
See how far those samples get you... Come back with specific questions if you have them.
 
Most of what i have came across are base upon a fixed query with fixed number of fields as the base. How can i create a query with a dynamic set of fields.

Example, if i select June, the query will returns 6 fields; Jan to Jun
But if i select May, the query will return 5 fields; Jan to May
 
Obviously you need to have prefixed columns to be able to attach it to a report or form...

You can use a Pivot query and use the "in" to define even non-existing months.
That way you can have a report or form with the columns in place.
 

Users who are viewing this thread

Back
Top Bottom