I have a report named jobrpt.
It has several reports and I need to be able to select 1 of them and print it off.
I have created a form named mainfrm and have created a combo box I have called ComboReports. In row source this is the code I typed in :
Row source Type is set to Tables
I then created a button named PrintReport
The code I typed into the button event is
The button works but I have to view all the reports instead of just the one I selected. Can anyone help as I am completely new at this?
It has several reports and I need to be able to select 1 of them and print it off.
I have created a form named mainfrm and have created a combo box I have called ComboReports. In row source this is the code I typed in :
Code:
SELECT [jobtbl].[ID], [jobtbl].[Critical Task Number], [jobtbl].[Job] FROM jobtbl ORDER BY [Critical Task Number] DESC;
I then created a button named PrintReport
The code I typed into the button event is
Code:
Private Sub PrintReport_Click() If ComboReports.ListIndex = -1 Then MsgBox "Please select a report first" Exit Sub End If DoCmd.OpenReport "jobrpt", acPreview, "[Forms]![mainfrm]![ComboReports]=" & Me.ComboReports End Sub
Comment