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

Setting Public Const through Code

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
Is there a way to set a Public Const once, through code at startup for example instead of running code to get it every time I need it. I have a function to obtain the computer username and I want to set a variable (public const) to that username when you enter the database. I have tried putting a statment like the one below in the function that runs a startup but error messages tell me it can't be in there. Invalid Attribute problems.

Public Const = ap_UserName()

Help!
 
Nope - public constants are constants -> meaning they are assigned et design time, not runtime.

Use a public variable in stead, and assign in your startup code.

Roy-Vidar
 
Or simply use your public function ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top