[AccessD] Is it possible to update VBA code with VBA?

Darryl Collins Darryl.Collins at iag.com.au
Thu Jan 13 17:08:29 CST 2011


_______________________________________________________________________________________

Note: This e-mail is subject to the disclaimer contained at the bottom of this message.
_______________________________________________________________________________________



It can be done, although as others have mentioned, it is probably not the optimal solution for you.
but in case you are curious or want to take that path, there is the link to one of the better sites for using code to mode the VBE.

<<http://www.cpearson.com/excel/vbe.aspx>>

regards
Darryl. 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Friday, 14 January 2011 9:41 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Is it possible to update VBA code with VBA?

All,

We have an Access application that creates a number of reports and is
used by several people.  In addition, because the application is fairly
new, it is being enhanced on a regular basis.

In order to avoid confusion, we have decided to establish a simple
"Application Version ID" that is shown at the bottom of all reports (and
also on forms).  The format of this Version ID is
Day.Month/Day/Year at Hour:Minute (example Thu.1/13/2011 at 15:53).  This
works nicely when we want to see which version of the application was
used to generate a previously generated report, etc.

Currently, we have a simple routine which generates our Version ID.
When changes are made to the application by our programmer, this routine
is used to generate a new Version ID and display it in a TextBox.  We
then manually copy this generated ID into the value of a Global Constant
field which is referenced in several places in the application.  (Note
that only the Access programmer is allowed to change the application.)


This process works Okay, but it would be better if we could
programmatically update the value of the constant field when the
application is changed by the programmer.  

Is there a way to update VBA code with VBA?  In other words, can a VBA
routine update other VBA code? (A small routine to generate our Version
ID and then plug the generated ID into the value of a Global constant).

Here is our Global Constant Field with its value. 
Global Const Con_Version_ID As String = "Thu.1/13/2011 at 15:53"

This might be a really dumb question.  We just have never tried to do
this before.

Thanks for your help.
Brad

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

The information transmitted in this message and its attachments (if any) is intended 
only for the person or entity to which it is addressed.
The message may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in reliance 
upon this information, by persons or entities other than the intended recipient is 
prohibited.

If you have received this in error, please contact the sender and delete this e-mail 
and associated material from any computer.

The intended recipient of this e-mail may only use, reproduce, disclose or distribute 
the information contained in this e-mail and any attached files, with the permission 
of the sender.

This message has been scanned for viruses.
_______________________________________________________________________________________




More information about the AccessD mailing list