var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Trying to modify query using Drop Downs
What I am trying to do is make it easier for NON-ACCESS types to run reports from a single form. Here are details of what I have, and am trying to do…
Currently there are two tables with the following information in each:
( Table#1 has more info, but it is not relevant to this situation. Note that in the query the information for Table#1 is linked to Table#2 via SSN.)
I first run a query (Query#1) that ..
1- deletes any existing table by the name of EMP_Roster
2- creates a new roster of all employees who have active marked as ‘YES’
Next I am trying to take information from a drop down list in Form#1 that asks for:
Okay, now the problem – how do I get the above information into the query so it can look for the information? If I do it manually, I use a query such as this:
Update To: [Table#2].[FY_Quarter]
(I couldn't get this to format correctly in the way that it shows up on the screen)
I need to be able to modify this query using VBA (I am weak in VBA but know NOTHING about SQL) so that my users selections from Form#1 can generate the correct data.
Can someone help me? If necessary, you can email me with the information, or to ask for more clarification.
THANK YOU !!
Re: Trying to modify query using Drop Downs
From what I can tell you have 4 different combo boxes. Regardless of how many, you can run your query based on the info in those combo boxes. To do this, link the Criteria in the field(s) of the query to the combo boxes using the Expression Builder. Check Access Help for more info.
Let's see.. In the criteria field of the query just use this format.
That will pass the value from the current open form. However, I believe the form has to remain open.. So if you were printing a report based off the values in those combos.. You go do something like
Private Sub CommandButton_Click()
docmd.openreport "ReportName", acnormal
Then in the report stick this in it.
Private Sub Report_Close()
So after it prints, when you close the form.. It sets focus back to the form and restores it..