Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenReport action in Macro

Status
Not open for further replies.

uscitizen

Technical User
Jan 17, 2003
672
US
according to ms a2k's online help wrt this:

"To open a report and restrict its records to those specified by the value of a control on a form, use the following expression:

[fieldname] = Forms![formname]![controlname on form]

The fieldname argument is the name of a field in the underlying table or query of the report you want to open. The controlname on form argument is the name of the control on the form that contains the value you want records in the report to match"

i have a report which is based upon a form and correlated sub-form. the field's 'Patient Number' and 'Cycle' are the linking fields between the report and the sub-report, however my interest is in further restricting the report to only those records from the sub-report having a particular value of 'Medication'.

so, i currently have a form called 'Trtmnts_Admnstrd' which allows the user to input values from three numeric, unbound, controls on it. additionally, there's a 'Print' button which on getting the click from the user launces a Macro which uses the OpenReport action -- and currently that macro's where condition reads:

[Cycle]=[Forms]![Trtmnts_Admnstrd]![Cycle] And [Patient Number]=[Forms]![Trtmnts_Admnstrd]![Patient Number] And [Medication]=[Forms]![Trtmnts_Admnstrd]![Medication]

however, that's not doing it -- in the sense that Medication's not getting filtered.

has anyone encountered this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top