Hi, I have created a simple report with only one textbox (unbound). In my vba module, there is a variable named "Var1". Can anyone tell me how to print Var1 to the textbox on the report? Thanks.
Hi, I have created a simple report with only one textbox (unbound).
In my vba module, there is a variable named "Var1". Can anyone tell
me how to print Var1 to the textbox on the report? Thanks.
Your text box can't read the variable directly. You can either have a
function in the module that simply returns the value of the variable,
and then set your text box's controlsource to an expression that calls
the function; e.g.,
=fncGetVar1()
or if the variable is Public, you can have code in a report event to set
the value of the textbox to the variable's value.
Say the form is "frmData" and the Name of the TextBox is "boxVar1";
then its contents can be referenced from a report launched from the form.
They would be referenced as "=[Forms]![frmData].[Form]![boxVar1]".
Jacky said:
Hi, I have created a simple report with only one textbox (unbound).