OpenArgs question

C

cinnie

hi to all

My form has a command button (cmdPrintRpt) and an unbound option group with
several option buttons. When I click cmdPrintRpt, it opens report rptSummary.

How do I pass the value of the option choice to the report using OpenArgs.
I can't seem to get the syntax correct in the DoCmd.OpenReport line.

Thanks
cinnie
 
A

Allen Browne

Try:
DoCmd.OpenReport "Report1", acViewPreview, OpenArgs:=Me.Frame1.Value

Option groups have a numeric value, so this will pass the OptionValue of the
chosen option button, or Null if no buttons are chosen.

Requires Access 2002 or later.

You could also read the option group's value from the report:
=Forms![Form1].[Frame1]
 
C

cinnie

Excellent

Have a happy New Year
--
cinnie


Allen Browne said:
Try:
DoCmd.OpenReport "Report1", acViewPreview, OpenArgs:=Me.Frame1.Value

Option groups have a numeric value, so this will pass the OptionValue of the
chosen option button, or Null if no buttons are chosen.

Requires Access 2002 or later.

You could also read the option group's value from the report:
=Forms![Form1].[Frame1]

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

cinnie said:
hi to all

My form has a command button (cmdPrintRpt) and an unbound option group
with
several option buttons. When I click cmdPrintRpt, it opens report
rptSummary.

How do I pass the value of the option choice to the report using OpenArgs.
I can't seem to get the syntax correct in the DoCmd.OpenReport line.

Thanks
cinnie
 

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