D
dgunning
I'm a pretty new Access user, so maybe I'm doing this the hard way. But
nothing I've tried has worked, so I'd really appreciate some help.
I have a report which is based on a parameter query. I can determine the
value of the parameter through code, and so I don't want to fill in a pop-up
box everytime I run the report; I want to establish the value of the
parameter in the reports onOpen event and then open the report using this
value. My code in the onOpen event is:
Private Sub Report_Open(Cancel As Integer)
Dim db As DAO.Database
Dim qry As DAO.QueryDef
Dim rst As DAO.Recordset
Set db = CurrentDb
Set qry = db.QueryDefs("qryWO")
qry.Parameters("EOMDATE").Value = #3/31/2008#
Set rst = qry.OpenRecordset
Me.RecordSource = rst.Name
The literal date above for the parameter value is just an attempt to keep
the code short while I get this working, once this works I will read the
value from a table.
When I run this, the pop up asking for the parameter value still comes up.
I've tried actually removing the parameter from the query, removing the
recordsource from the report. No matter what I do, the user is always
prompted for the parameter. Thanks for any help.
nothing I've tried has worked, so I'd really appreciate some help.
I have a report which is based on a parameter query. I can determine the
value of the parameter through code, and so I don't want to fill in a pop-up
box everytime I run the report; I want to establish the value of the
parameter in the reports onOpen event and then open the report using this
value. My code in the onOpen event is:
Private Sub Report_Open(Cancel As Integer)
Dim db As DAO.Database
Dim qry As DAO.QueryDef
Dim rst As DAO.Recordset
Set db = CurrentDb
Set qry = db.QueryDefs("qryWO")
qry.Parameters("EOMDATE").Value = #3/31/2008#
Set rst = qry.OpenRecordset
Me.RecordSource = rst.Name
The literal date above for the parameter value is just an attempt to keep
the code short while I get this working, once this works I will read the
value from a table.
When I run this, the pop up asking for the parameter value still comes up.
I've tried actually removing the parameter from the query, removing the
recordsource from the report. No matter what I do, the user is always
prompted for the parameter. Thanks for any help.