Print report newbie question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i am totally new at reports and I'd like help with this question.
I use two unbound combo boxes on my form (cbxSession) and cbxDay) to select
matching records from the underlying query. (works great) Now I have added a
Print button with the following code:

Dim stDocName As String
stDocName = "rptTest"
DoCmd.OpenReport stDocName, acPreview

When I click the button, I get two parameter messages asking for the values
of the combo boxes. What is the right syntax to print only the records that
are already selected and on the form? Also, is it done by the button's code
or in the report's code?

thank you for your help
 
Victoria,
You need to reference the values contained in the controls on the open form.
Place this in the ControlSource of cbxSession...
=Forms!frmYourFormName!cbxSession
And for cbxDay...
=Forms!frmYourFormName!cbxDay

I'm a bit confused as to how your filtering the report though. I would expect that
those 2 values would be used to filter the records delivered to the report via the
underlying query...
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
Back
Top