I posted this question on the microsoft office online and Al Campagna was very kindly helping me with it. I have been unable to post a reply for several days as I keep getting 'service temporarily unavailable' messages. Or I manage to post a reply but it tells me it didn't accept it. If Al looks at this forum I apologise.
What I am trying to do is to filter a report via an unbound form (ParamForm) which has a combobox with the bound field EmployeeID and a command button with the following in the OnClick Event.
Private Sub Command2_Click()
Refresh
If IsNull(cboFindName) Then
DoCmd.OpenReport "r_EventsAttendedByEmployee", acViewPreview
Else
DoCmdOpenReport "r_EventsAttendedByEmployee",,EmployeeID= "& Me.cboFindName)
End If
End Sub
This opens the report if the combobox is blank showing all employees perfectly but if there is a name in the combobox I get a perfectly formatted report but no details on it.
What am I doing wrong?