Sub-report filter question

  • Thread starter Thread starter Ynot
  • Start date Start date
Y

Ynot

I have a report with a subreport. I am printing it via a button and code
from a form with a subform. I am trying to print one page with the same
information that is on the screen in the form/subform combination. I have
tried several solution posted here and can't seem to get them to work. The
report works fine, selecting the correct subreport is the problem Here is
one example solution I tried: Try this:Base the subreport on a stored query
that uses the user form to get it'scriteria:select * from tblSubDataTable
where Active=Forms!frmUserForm!booCheckbox When the report is started it
pops up a dialog box asking for the parameter. It is not taking it from the
form, which is still active. If I key in the correct parameter, the
report/subreport prints correctly. What am I doing wrong????An example, I
want to print report "job1" subreport "Work order 3". As I said the
report works fine, the subreport is what I have to select correctly



Job 1

Job 1 - Work order 1

Job 1 - Work order 2

Job 1 - Work order 3

Job 1 - Work order 4

Job 2

Job 2 - Work order 1

Job 2 - Work order 2

Job 2 - Work order 3

Job 2 - Work order 4
 
Ynot said:
I have a report with a subreport. I am printing it via a button and code
from a form with a subform. I am trying to print one page with the same
information that is on the screen in the form/subform combination. I have
tried several solution posted here and can't seem to get them to work. The
report works fine, selecting the correct subreport is the problem Here is
one example solution I tried: Try this:Base the subreport on a stored query
that uses the user form to get it'scriteria:select * from tblSubDataTable
where Active=Forms!frmUserForm!booCheckbox When the report is started it
pops up a dialog box asking for the parameter. It is not taking it from the
form, which is still active. If I key in the correct parameter, the
report/subreport prints correctly. What am I doing wrong????An example, I
want to print report "job1" subreport "Work order 3". As I said the
report works fine, the subreport is what I have to select correctly


When you get a pop-up prompt, it means that you did not
specify the parameter corrrectly. In this case, it looks
like you may have misspelled the form's or combo box's name.
Or maybe the parameter is in the subform and the parameter
says it's on the main form??
 
I triple checked for that and it is typed correctly. Would I address it
differently because it is an open subform of an open form?
 
Ynot said:
I triple checked for that and it is typed correctly. Would I address it
differently because it is an open subform of an open form?

If it's on a subform, then you have to provide the full
reference to the subform control:

Forms!mainform.subformcontrol.Form.controlonsubform
--
Marsh
MVP [MS Access]



 
Marshal. THANX..............

That did it!

Marshall Barton said:
Ynot said:
I triple checked for that and it is typed correctly. Would I address it
differently because it is an open subform of an open form?

If it's on a subform, then you have to provide the full
reference to the subform control:

Forms!mainform.subformcontrol.Form.controlonsubform
--
Marsh
MVP [MS Access]



 
Back
Top