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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a variable to the Report

Status
Not open for further replies.

DanKay1

Programmer
Jun 9, 2004
54
0
0
US
Is it possible to assign a textbox/label inside report that will get a variable assigned to it.

Ex. I am trying to run a function that will calculate results and I want to open Report and show that result.

Thank you.
 
Just set the control source of your text box to be the function, i think.
 
No that wont work because i am calling that function from somewhere else.
 
what do you mean by "somewhere else" and what is the function?
 
Private Sub Add(x,y)
z=x+y
docmd.openreport Addition
Report_Addition.labelName=z
end sub

it doesn't pass the variable to that report.
 
Have you tried passing it to the tag property or as the openargs?
 
Dan,

- open the report in designview, hidden
- change the value (or caption, if the diplay field is a label) to your variable
- close the report, saveyes
- reopen the report (normal, preview, what you like)

HTH,
fly

[blue]Typos, that don't affect the functionality of code, will not be corrected.[/blue]

Martin Serra Jr.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top