bostonfrog
Programmer
In a module I declared a public variable called gUserName As String, available to be used on any form or object in the database. It's current value is stored depending on who logs on from a logon form. For example, I am using the value of gUserName to determine what happens when a form loads, but I've hard-coded the users' names (2 letters), and it won't be useful if new users are added later and there is no one to edit the VB code! This is how it looks now, but this code isn't any good in the long term:
In this case, there would always be these 2 sets of users (some who are downtown and others uptown), and thus two cases continually re-used. Any suggestions?
-- Michel
Code:
Private Sub Form_Load()
Select Case gUserName
Case "ka", "kb", "de", "mb", "dm", "rp"
' change recordsource dynamically
' change form's caption
' do other things to the form ...
Case "ms", "mm", "es", "sp", "cm", "mg"
' change the recordsource
' change the form's caption
' do other things to the form ...
End Select
-- Michel