I have a combo box of single column with nine entries and runs a very complicated query when user clicks one of the entries.
Each entry creates it's own EXCEL spreadsheet.
Works just fine, sample of WHERE clause below:
WHERE (((AcctDivName)=([FORMS]!frmGetDiv![comboDivNbr])) AND
((WEEKENDINGDATE)<=FiscalCalendar.DateRange2) And ((FISCALCALENDAR.FISCALMONTH)=1) AND
(SUPPORT.PROJECTNUM = IMPORT.PROJECTNUM AND ProjectId=GROUPCODE))
GROUP BY ProductSeq, ProductName
Of course, user now wants to run all the entries in the combo box from a single click on the form creating nine EXCEL spreadsheets.
How would I code this to pass each of the comboDivNbr values to a slightly modified query when the user clicks on a RUNALLBUTTON button that is on same FORM???
What I currently have that works fine by clicking on combo box value:
just a proposal
1. replace the [FORMS]!frmGetDiv![comboDivNbr] with a parameter
2. put your comboDiv_Click code into a sub with the param DivNbr. set the querys parameter to DivNbr
3. call the sub from within the RUNALLBUTTON_Click() event too using
for i = 1 to comboDivNbr.ListCount