Query selection from dropdown list

rasheedavail

New member
Local time
Yesterday, 20:54
Joined
Dec 16, 2012
Messages
3
I have a simple table in excel, converted it into access 2007. The 30 columns in table corresponds to 5 categories. For this table I have designed 5 queries to view each category details individually.

I want to give a dropdown list to the user to choose the category of interest to view details. It means I need to give the list of 5 queries and only the one selected by user should get executed. Please help me how to do this. Using macros or some other option.


Thanks in advance.
 
Hello Rasheed.
attached in the zip folder you will find two databases sample, one is on Access 2010 and the Other One I saved as Older Version can be opened on Access 2000 or 2003
You will find a table for exaple tblProducts, and a Form also frmProducts,
I made a short example for you to see how this works the controls on this form is unbound which means you cannot edit it and save the edited data, it is only for viewing purpose, so if you want to edit it, we can work another sample also, this is the easiest way in my opinion for how to show data based on dropdown list, but it is not that practical when you have so much data in one record.
check it and feel free for any question.

and Still the Idea of Spliting the Data into two tables and relate them together or creating a query based on this table will be more productive.
you need to refer to the links provided by jdraw as it would help you understanding table relations much better.
 

Attachments

Thank you jdraw and khodr.

As per your suggestions I realised that the number of fields are many and has split my master table into three tables of 10 fields each.

I have made a sample database for clarification and wrote 5 queries in it. Now I want the user to give name in runtime parameter and then select an option from drop down menu which shows "select 1 for T1Q1, 2 for T1Q2, 3 for T1Q3, 4 for T2Q1 and 5 for T3Q1."

Please review the attachment. Your suggestions will be highly appriciated.
Please let me know which area I need to work on to generate such an option for end user i.e. using FORMS/REPORTS/MACROS/VB.

Note: The tables and queries follow the same format with my real database i.e. the primary key is same in each table and there is no need of any joins.
 

Attachments

It would be more helpful/useful if you used real table names and meaningful field names.
 

Users who are viewing this thread

Back
Top Bottom