Report based upon parameter query

HartJF

Registered User.
Local time
Today, 03:53
Joined
Jul 23, 2010
Messages
34
I'm confident that a simple answer exists, but, after consecutive twenty-hour days, I can't find it.

I have a report based upon a parameter query. The parameters are determined programmatically. I need to set the parameters when I open the report.

I have placed the following code in the Open event of the report.

Code:
Dim varArguements As Variant
Dim qdfYearTermSession As QueryDef
    
Set qdfYearTermSession = CurrentDb.QueryDefs!qselYearTermSession
varArguements = Split(OpenArgs, ",")
    
With qdfYearTermSession
   !prlYearTermSession = varArguements(0)
   !prbBudgetGoal = varArguements(1)
   !pryPriorYear = CBool(varArguements(2))
End With

I have tried various changes to this code, such as opening a RecordSet against the QueryDef. Regardless of what I do, the Enter Parameter Value prompts appear. If I re-enter the parameters manually, the report executes correctly.

What am I doing wrong? Thanks for your insights!
 

Users who are viewing this thread

Back
Top Bottom