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!

Passing a public variable to a text box in a report 1

Status
Not open for further replies.

drazeni

Programmer
Apr 21, 2001
66
ZA
I have a public variable called "str_invoice_type" and before I run a report from a form, I assign a value to this variable and would like to pass it to a text box called "invoice_type" in the report. I have set the controlsource of "invoice_type" to "str_invoice_type".

My problem is that the text box in the report doesn't want to accept this value. How do I accomplish this?

Thanks.
 
A simple way is to create a Public Function that returns the value of your variable:

Public Function Get_Invoice_Type() as String
Get_Invoice_Type=str_invoice_type
End Function

and use it in the source field of your report's text box:
=Get_Invoice_Type()

Please note you have to define the type of this function according to the actual type of str_invoice_type - I assumed String in my sample-

Hope that answer your question

 
Thank you, this did work.

Much apprciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top