I understand the concept that a CONST variable doesn't change. BUT I want to know if its possible to set the value of a CONST dynamically when the database starts up.
Here's what I want to do: I have a multiuser database. When the db starts up I want to look up the value from a field in a table and store it in the CONST. Once the CONST is set, it does not need to change.
I am using VBA with a 2003 Access database on a network drive, and local drive.
Currently, I am using a GLOBAL variable, and every once in a while the variable loses its value and gets reset to "" to counter this I have inserted an IF statement before every instance of the GLOBAL to check if its value is "", if it is, a DLOOKUP is called.
SO, can I dynamically populate a CONST? I have tried in a class module trying to set it to a DLOOKUP statement, tried setting it to a variable and neither worked.
Here's what I want to do: I have a multiuser database. When the db starts up I want to look up the value from a field in a table and store it in the CONST. Once the CONST is set, it does not need to change.
I am using VBA with a 2003 Access database on a network drive, and local drive.
Currently, I am using a GLOBAL variable, and every once in a while the variable loses its value and gets reset to "" to counter this I have inserted an IF statement before every instance of the GLOBAL to check if its value is "", if it is, a DLOOKUP is called.
SO, can I dynamically populate a CONST? I have tried in a class module trying to set it to a DLOOKUP statement, tried setting it to a variable and neither worked.