Hi all,
I have read some conflicting threads regarding list boxes and reports. Can anyone help?
My form frmSelect has a listbox with row source tblEmployee, I would like to be able to make selections on the listbox, click the command button and open the report for only those selected. My report "Training Report" runs off a query "Training Query".
The OnClick event is below, but returns all records in the report. What am I missing?
thanks,
millrat
Private Sub cmdPreview_Click()
On Error GoTo Err_cmdPreview_Click
Dim stDocName As String
stDocName = "Training Report"
DoCmd.OpenReport stDocName, acPreview, ,"[Training Query].EmpID=" & Me.lstEmployee.Column(0)
Exit_cmdPreview_Click:
Exit Sub
Err_cmdPreview_Click:
MsgBox Err.Description
Resume Exit_cmdPreview_Click
End Sub
I have read some conflicting threads regarding list boxes and reports. Can anyone help?
My form frmSelect has a listbox with row source tblEmployee, I would like to be able to make selections on the listbox, click the command button and open the report for only those selected. My report "Training Report" runs off a query "Training Query".
The OnClick event is below, but returns all records in the report. What am I missing?
thanks,
millrat
Private Sub cmdPreview_Click()
On Error GoTo Err_cmdPreview_Click
Dim stDocName As String
stDocName = "Training Report"
DoCmd.OpenReport stDocName, acPreview, ,"[Training Query].EmpID=" & Me.lstEmployee.Column(0)
Exit_cmdPreview_Click:
Exit Sub
Err_cmdPreview_Click:
MsgBox Err.Description
Resume Exit_cmdPreview_Click
End Sub