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

Using a Public Const in a report 1

Status
Not open for further replies.

Binnit

Technical User
Apr 28, 2004
627
US
I have declared a public const in a module which works fine using the intermediate window.

I want to use this constant in a control on a report but it does not recognise it.

Can someone tell me why or how I can get it ona report.

Thanks

Happiness is...not getting what you want but wanting what you have already got
 
Create a small user-defined function that returns the constant. Then set a control source of a text box to the function:

Code:
Public Function GetConstant() as String
    GetConstant = cstrMyConstant
End Function

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
dhookom
Great stuff... simple when you know how

Thanks

Happiness is...not getting what you want but wanting what you have already got
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top