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!

subreport woes (unexpected parameter prompting)

Status
Not open for further replies.

uscitizen

Technical User
Jan 17, 2003
672
US
I have a form called “Trtmnts_Admnstrd” whose purpose is to let the user identify the record in the database (s)he wants to appear in a report called: “Treatment Administered”. On this form are three combo boxes and two buttons.

The combo boxes consist of two numeric unbound controls (“Patient Number” and “Cycle”. The third unbound control is text (“Medication”).

The two buttons serve to “Print” a report and to let the user “Close” this form.

The “Print” button has a macro attached to the ‘On click’ event property that activates a report “Treatment Administered”. “Treatment Adminstered” consists of a parent report and a correlated (child) sub-report called “Treatment and Toxicity” and “Protocol Medications”, respectively, and the linking fields (as I call them) in each are “Patient Number” and “Cycle” in the child and “Patient Number” and “Cycle Number” in the master. “Medication”, which is defined by the user on the third unbound control is on the sub-report which we said is called “Protocol Medications”.

The “Where condition” of the “Open Report” action of the macro that the clicking action launches is:

[Cycle]=[Forms]![Trtmnts_Admnstrd]![Cycle] And [Patient Number]=[Forms]![Trtmnts_Admnstrd]![Patient Number] And [Forms]![Treatment and Toxicity]![Protocol Medications]![Medication]=[Forms]![Trtmnts_Admnstrd]![Medication]

Here’s the punch-line: when I click “Print” on the “Trtmnts_Admnstrd” form, you’re prompted to provide “Cycle” followed by [Forms]![Treatment and Toxicity]![Protocol Medications]![Medication]

Suffice it to say this has me scratching my (newbie) head as in slightly bamboozled: I know these ‘prompts’ suggest that the data aren’t getting passed along, but why not?

anyone got a clue?

 
Well, include the field Cycle in the query.
Then...

[Forms]![Treatment and Toxicity]![Protocol Medications]![Medication]

1. Is the form [Treatment and Toxicity] open?

2. I think the chain is too long...is [Protocol Medications] a subform? Then use [Protocol Medications].Form![Medication]

3. Check the report for any reference to the above, especially in Grouping/Sorting.


HTH



[pipe]
Daniel Vlas
Systems Consultant

 
hi --

to cover the items you raised in your reply:

1) there is no sorting/grouping in this report.

2) form 'treatment and toxicity' is not an open form (is it needed to be open; it would be kind of gnarly to have it open and visible -- if needed to be open, could it be made open invisibly to the user. also, i guess it'd have to be closed after printing the report.

3) isn't 'cycle' in the query already; what'd you mean by "then include 'cycle' in the query"?

4) here's the chain modified:

[Cycle]=[Forms]![Trtmnts_Admnstrd]![Cycle] And [Patient Number]=[Forms]![Trtmnts_Admnstrd]![Patient Number] And [Forms]![Treatment and Toxicity]![Protocol Medications]![Medication]=[Forms]![Trtmnts_Admnstrd].[Forms]![Medication]

notice i used the plural of "Form" in correcting my code on the assumption that that would be consistent with the use of the plural of this term everywhere else.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top