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

Need to reference a variable from a macro.

Status
Not open for further replies.

qu1ncy

Programmer
Jul 25, 2002
95
CA
Hi,

Our Client Support team has been posed this question from one of our developers.

He has a macro in an Access application that has a message box. Part of the message displayed is the path to a certain file. He references this path 'string variable' by embedding the following SavePath function (below)in the sting which formats the message.

Public Function SavePath() As String
SavePath = CopyPath
End Function

He declares the variable as follows:

Public Const CopyPath As String = "F:\RAS\IAS\SAGE\Daily\Backup"

His 2 questions are:

How can he eliminate the creation of the SavePath() function to embed the CopyPath value in the message box macro?
There must be a better way than to keep on creating more functions just to reference the value of variables set in code.
Is there syntax we can use to directly reference the value for a code defined variable from a macro?

Any help with this is appreciated.

Thanks
 
Actually, this is the ONLY way I could find to do it... And one of the reasons to jump off the macro ship...

[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top