Using citeria from Cascading combo Boxs from report output

M

Martin Hopkins

Hello,

I have a form where users can select citeria from several combo boxes to use
as the background values for a number of reports.

For Instance:

The user may wish to select a nominal roll for all personnel in a Wing, they
select the desired wing from the combo box and select the nominal roll
button to run the report. All works well.

However, if the user wants to select only a certain sqn from the wing the
rpeort still returns the whole wing. On the user form they select the Wing
in one combo box, the sqn combo box only returns values that are related to
the desired wing, the user selects the sqn.

On running the report the user is returned with all personnel in the wing
and the report is not restricted to the selected sqn.

The background query to the report is constructed to have one or other of
the values selected. I have tried to construct it to say If Wing & Sqn
selected then run for the Sqn only but to no success.

I am stuck. The answer is probadly obvious but my mind is frozen.

What I would like to do is run the report on the selections from the user eg
If Wing selected then only return personnel in the wing. If Wing & Sqn
selected then only return personnel in the Sqn selected not Wing & Sqn.

Thanks in adavance

Martin Hopkins
 
G

Guest

If sqn is a text field, try

DoCmd.OpenReport "ReportName", acViewPreview, , "[sqn] like '" &
Me.ComboForSQN & "'"

if it's a number try

DoCmd.OpenReport "ReportName", acViewPreview, , "[sqn] =" & Me.ComboForSQN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top