OpenArgs question

  • Thread starter Thread starter cinnie
  • Start date Start date
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
 
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]
 
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
 
Back
Top