Sep 12 2005, 05:15 AM
I would like to use the value of a variable defined in the module in a report. I created a text box and assigned the control source property to "=[sCurrency]" where sCurrency is the variable defined in the module. This is not recognized and asking for the parameter value for "sCurrency" while running the report, but when I use the same variable in forms it shows the value stored in the variable "sCurrency".
This is very much required as I need to print the currency type in the reports using the public variable.
Could any one give any suggestion for this ?
Thanks in advance.
Sep 12 2005, 05:21 AM
You must write a function that will return the value. Something like this
Public Function GetCurrency() As String
GetCurrency = sCurrency
Then use the function name in the control source property
Sep 12 2005, 05:22 AM
Use a function to return the value of your global variable:
Public Function fCurrency() As String
fCurrency = sCurrency
Make the function return the same datatype as sCurrency (I'm guessing it's a string since it's called 's'Currency)
Sep 12 2005, 09:37 PM
Dear Bo Melin & CheekyBuddha,
Thank you so much, it works. I really appreciate the great support provided by both of you.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here