Endlessknight
New Member
- Joined
- Oct 28, 2016
- Messages
- 36
Greetings all,
I inherited a databases from a co-worker. It has a form with a combo_box and button to generate a report based on the item selected via the combo_box.
I wrote a function that, see below, that opens the report, looks up the location to save it in a table, saves it a then closes the report.
How can I get the function to loop through all the items in the combo_box without me having to manually select them?
Thanks in advance for any input, it's greatly appreciated.
I inherited a databases from a co-worker. It has a form with a combo_box and button to generate a report based on the item selected via the combo_box.
I wrote a function that, see below, that opens the report, looks up the location to save it in a table, saves it a then closes the report.
How can I get the function to loop through all the items in the combo_box without me having to manually select them?
Thanks in advance for any input, it's greatly appreciated.
Code:
Function Expo_allPDF()
Dim MyPath As String
MyPath = DLookup("Field2", "Table", "Field1 = '" & [Forms]![ChgsMstrCommands]![Combo_SelectRVURenderingForRpts] & "'")
DoCmd.OpenReport "Reportname", 2
DoCmd.OutputTo 3, "Reportname", acFormatPDF, MyPath, True
DoCmd.Close 3, "Reportname"
End Function