M
Mishanya
I have Mainform with cboSelectClientID and MyReport report based on query
wich includes ClientID field.
On the Mainform I've put command button and programmed it on click event as
follows:
Dim strWhere As String
strWhere = "[ClientID]=" & Me![SelectClientID]
DoCmd.OpenReport "MyReport", acPreview, strWhere
If I understand right, the button is supposed to open the MyReport with
selected in the cboSelectClientID client-recordset while the Filter property
of the report has to change to [ClientID] = ClientID Autonumber selected in
the cboSelectClientID.
It does opens the report - but no filtering happens. Moreover, somehow it
opens the report even with cboSelectClientID unselected (Null), although I'm
supposed to get error msgbox requiring to select ClientID first.
What should I check to workaround the task?
wich includes ClientID field.
On the Mainform I've put command button and programmed it on click event as
follows:
Dim strWhere As String
strWhere = "[ClientID]=" & Me![SelectClientID]
DoCmd.OpenReport "MyReport", acPreview, strWhere
If I understand right, the button is supposed to open the MyReport with
selected in the cboSelectClientID client-recordset while the Filter property
of the report has to change to [ClientID] = ClientID Autonumber selected in
the cboSelectClientID.
It does opens the report - but no filtering happens. Moreover, somehow it
opens the report even with cboSelectClientID unselected (Null), although I'm
supposed to get error msgbox requiring to select ClientID first.
What should I check to workaround the task?