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

Displaying a Variable on a Report 1

Status
Not open for further replies.

mdweezer

Technical User
Jun 15, 2004
56
US
Currently I have a form. From it I am passing values to a report to generate a SQL qry which I then execute using Me.Recordsource = Foo

Within the report code I am also putting together a string based on the criteria of the form i'm launching the report with. The variable is of type string and is called "list".

When I execute the report, how do I get this variable to display on the report?

Thanks.
 
If you store the variable value in an invisible text control on the form calling the report you can make a direct reference to that control.

Code:
=FORMS![formname]![controlname]

Or change the variable to a database Global variable. Then create a function to retrieve this global variable.

Code:
Global vStrVar as String
Public Function StrVar as String
StrVar = vStrVar
End Function

Now make a call of the function to retrieve the string value:

Code:
=StrVar()

Post back if you have any questions.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
I had gotten the same result from another forum and it worked perfectly.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top