I have been trying to bypass the parameter query used in a Report Record Source using DoCmd.SetParameter in VBA. I've not used this format and I can't change the base Report Record Source and remove the parameter. Iseem to be a little thick in the head on the use of DoCmd.SetParameter.
I get the following error:
Run-time error '2766':
The object doesn't contain the Automation object 'IN5201234.'
when running this code off of a button:
The parameter query that filters the report is:
Misc info:
This is not a database I work with or designed and is >20yrs old. The reports use a parameter query to fill in a number for the report record source. They want to restrict the dozens of reports down for a particular group. I've included a test database. Right now, I am just working through the coding elements.
Use IN5201234 when testing.
I get the following error:
Run-time error '2766':
The object doesn't contain the Automation object 'IN5201234.'
when running this code off of a button:
Code:
Private Sub Print_Click()
DoCmd.SetParameter "Number0", Me.Text42
DoCmd.OpenReport "qCWS", acViewReport
End Sub
The parameter query that filters the report is:
Code:
SELECT CWS.NUMBER0, CWS.[System Name], CWS.ACTIVITY_STATUS_CD, CWS.TINWSYS_IS_NUMBER, CWS.Status, CWS.[Full Name]
FROM CWS
WHERE (((CWS.NUMBER0) Like UCase([Enter PWSID (Use IN + PWSID)] & "*")));
Misc info:
This is not a database I work with or designed and is >20yrs old. The reports use a parameter query to fill in a number for the report record source. They want to restrict the dozens of reports down for a particular group. I've included a test database. Right now, I am just working through the coding elements.
Use IN5201234 when testing.