declaring constant variables using if's and elsif's
Posted on 1999-07-20
I have a workgroup that stores userid's and pwd's, these are in the format of the user's windows nt logon id.
in a startup function, I'd like to parse the ID's into the person's name.
Public Function Startup()
If CurrentUser = "sgrafl01"
const username as String = "Sean Graflund"
Elseif CurrentUser = "dmarti01"
const username as String = "Donald Martin"
ElseIf .... and so on
I have about 12 logon ID's I'd do this with. It works fine with standard global strings, but I'd like to turn it into a constant. For some reason, after using the DB for awhile the global string turns to a zero lengh string. If I use a const string, it will always have it.
When I try to declare this as a constant, VBA gives a declaration declared multiple times error. Is there a way I can assign this as a const without getting that error or will I have to change all the User ID's to the correct person's name in the workgroup manager instead of using the same ID as is used for the Windows NT logon?