Something like the following should do it, probably in the Load event of the
form ...
Dim strTheUser As String
strTheUser = fOSUserName()
Select Case strTheUser
Case "FirstUserNameHere"
Me!NameOfTextBoxHere.DefaultValue = Chr$(34) &
"FirstUsersDefaultValueHere" & Chr$(34)
Case "SecondUserNameHere"
Me!NameOfTextBoxHere.DefaultValue = Chr$(34) &
"SecondUsersDefaultValueHere" & Chr$(34)
Case Else
Me!NameOfTextBoxHere.DefaultValue = Chr$(34) &
"DefaultValueForAllOtherUsersHere" & Chr$(34)
End Select
It doesn't matter what you call the module.
Chr$(34) returns a double quote character (34 is the ASCII code for the
double quote character). The default value property expects a string
enclosed in double quotes, and I find using the Chr$() function like this
easier than trying to embed quotes within quotes.
You can probably see from the example above that assigning default values
based on individual user names is only going to be practical while there are
a small number of users. You wouldn't want to write, or maintain, code like
this with hundreds, or even dozens, of users.
--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com
The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.