>I would like my VBA code to modify VBA code?
>Can this be done?
[quoted text clipped - 12 lines]
>developers do. I also use a table to store the constant string but I would
>like code to change code.
You do NOT want to be modifying VBA code on the fly. That
would be a heavy duty operation that would greatly increase
your program's vulnerability to corruption.
Since a Constant is constant, it's a bit of an oxymoron to
talk about changing it. I suggest that you find another way
to accomplish this activity.
How about this?
Public Const cODBCConnectStrA =
"ODBC;DSN=CA-SQL01-DEV;Description=CA-SQL01-DEV;UID=;DATABASE="
Public Const cODBCConnectStrB = ";Trusted_Connection=Yes"
Dim sConnect As String
sConnect = cODBCConnectStrA & strDBName & cODBCConnectStrB

Signature
Marsh
MVP [MS Access]