How can I get the list of reports I have in a database into a combobox? I want to be able to select a certain report and be able to print it from the form.
SELECT MSysObjects.Name AS ReportName FROM MSysObjects WHERE (((MSysObjects.Type)=-32764));
Paste that into a new query in SQL view.
Now perhaps your combo is called Combo1, and you have a command button to print the report, your command buttons "On Click" event would look something like this:
Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub
Your combo should be 1 column and you should set a default value for your combobox just to be safe if someone clicks the button when the combo is empty. That'll do it! Gord
ghubbell@total.net
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.