I have an unbound combo box in a form that I want to list ALL reports in.
Ive found multiple examples on the site but cant get them to work.
My combo bow is called ComboReports and I have set Row Source Type to Table/Query. In the RowSource box I have input
Expand|Select|Wrap|Line Numbers
- SELECT [MSysObjects].[Name] FROM MsysObjects WHERE (Left$([Name],1)<>"~") And ([MSysObjects].[Type])=-32764 ORDER BY [MSysObjects].[Name];
The part thats causing an issue is my button. I want it to open the selected report on click but its not working.
My button is called PrintReport and I have the following event procedure for on click
Expand|Select|Wrap|Line Numbers
- Private Sub PrintReport_Click()
- If Not IsNull(ComboReports) And ComboReports <> "" Then
- DoCmd.OpenReport ComboReports, acViewPreview ' use acNormal to print without preview
- Else
- MsgBox ("You Must First Select a Report To Print!")
- ComboReports.SetFocus
- End If
- ComboReports = ""
- End Sub
Thanks