If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Running 2 queries
I have created one complex query on our employees database and then another
query off of that one, it is very involved. My question: is there a way I can set up a form that when a user clicks on a drop down example: Balances (label) and in the drop down they would choose vacation, sick, comp, etc and then in another box: Max days (label) they would type whatever number and it would run from the 2 queries and bring me back information. Balances: comp (chosen from the drop down) Max days: 20 (they type in) It would bring back all the employees with comp and max days of 20 from the two queries. Thanks, |
#2
|
|||
|
|||
Running 2 queries
There are a couple of different methods to accomplish this depending on how
comfortable you are with VBA. To do it without VBA, create a copy of the query that is the control source for your form. Under the criteria block for balances, enter... Forms![YourInputFormName]![BalancesFieldName] Under the criteria block for Max Days, enter... =Forms![YourInputFormName]![MaxDaysFieldName] Replace the terms 'YourInputFormName', 'BalancesFieldName', and 'MaxDaysFieldName' with the actual name of the form and fields. Create a form to display the results (it can be a copy of your input form) and set its control source to the new query. On the input form, add a command button to open the new form. -- I''m not young enough to know everything. "Pammy" wrote: I have created one complex query on our employees database and then another query off of that one, it is very involved. My question: is there a way I can set up a form that when a user clicks on a drop down example: Balances (label) and in the drop down they would choose vacation, sick, comp, etc and then in another box: Max days (label) they would type whatever number and it would run from the 2 queries and bring me back information. Balances: comp (chosen from the drop down) Max days: 20 (they type in) It would bring back all the employees with comp and max days of 20 from the two queries. Thanks, |
Thread Tools | |
Display Modes | |
|
|