[AccessD] Compiler directives

Heenan, Lambert Lambert.Heenan at chartisinsurance.com
Wed Nov 3 15:24:29 CDT 2010


In the VBA editor select Tools/Your Db Name Properties, and on the general tab you will find the Conditional Compilations arguments text box.

But I guess I agree with Jim. CCDs are so well buried it's easy to forget you set them.

Lambert 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Wednesday, November 03, 2010 3:49 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Compiler directives

Sorry to ask for the answer to an old question, folks, but advanced age and lack of practice is causing serious memory lapses.



The central problem is that the client and I run the app in different environment, and that this in turn causes different definitions of various directory locations, etc.



>From within a given module, I know how to check for various compile 
>options,
but I cannot recall how to define them in the first place.



For example, a snippet ...



<vba>

Dim strTemplateDir as String

#If DEVELOPER Then

      strTemplateDir = "C:\SAS\Documents\"

#Else

      strTemplateDir = "C:\Documents And Settings\All Users\Documents\"

#End If

Dim strFileName as String

strFileName = strTemplateDir & "MyFile.dotx"

</vba>



The above sample code is required several times in various modules, so I thought that the simplest way was to pass a compile argument DEVELOPER which would compile the appropriate lines.



Perhaps I should add that I am not in search of run-time arguments, but rather compile-time arguments. However, if this is not the way to go, then I shall be willing to entertain the run-time arguments alternative.

So I want to define DEVELOPER while I'm working at home, but also issue to CLIENT a version without this argument, so that when she compiles it, the app references her directory structure and not mine.



To further complicate things, the client in question has a nasty habit of revising the Word templates and appending the revision-date to the filename.
I want to eliminate these complications, perhaps like this:



Define a constant MyTemplate, with a value such as MyFile_2010-11-02.dotx.

Refer to said constant using #MyTemplate in all the code.

When she or I choose to provide a new version of the template's filename, then all that is required is to revise the arguments, e.g. not touch a line of code.



Can anyone prod my failing memory and remind me how to define these?



I should add that I am developing in A2K7 while the client is running in A2K10. I don't know whether this complicates things further.



TIA,

Arthur
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list