Interview Question in Database Design


 

Interview Question :: MS Access - Use a Combo box to select a Query


I am re-designed a database we use - hopefully to make it easier to update in the future.

At the moment i have 2 tables - one for a list of occupations (80 of them) and a table for client details which gives 6 choices to choose a job.. There are 80 queries for each job that picks out what client is interested in that occupation.

What i'd like to do is have a form, that has a list box or a combo box. The user clicks on a job from that and next to it, the query displays for that particular job. I want the user to be able to click on another job right away and then that job displays.

Is this possible?

any help would be great.

i'd rather not use macro, vba or sql.


thanks.
Answers to "MS Access - Use a Combo box to select a Query"
RE: MS Access - Use a Combo box to select a Query?

Hi,

It is not clear exactly what kind of information is there in the tables and the relation between the tables.

What I can tell is u need not write 80 queries.



Suppose u r writing a query with some criteria like this

.... WHERE job="abcd"

Here u r writing the job name directly. It will give all records with job abcd.

Instead u can supply job from ur Form, Where u diplay jobs in a combo box. The name of the form is Form1 and that of combobox is combo1. Then u change in the query like this

.... WHERE job=forms!Form1!combo1

Now u run the form select a job from combo1 and run the query. The query will take value from combo1 on form1.

Put a command button on the form to run the query.
 
Vote for this answer ::  
Update Alert Setting