I once got help writing a script that referenced the username
to determine whether or not to copy a MASTER.mdb to c:\LocalCopy\FrontEnd.mdb
The script, checked a folder for a dummy file with extension .upd for example:
username.upd
(The folder had files - user1.upd, user2.upd, user3.upd)
If it found the username.upd it would copy the master.mdb to their local
folder
as an updated front end.
All the DBA would have to do is to delete the username.upd file in the
UserUpdate folder, in order to initiate a "push" to desired users for the
update.
code should go something like this:
====================================
if exist "\\Disk1\UserUpdates\username.upd" GOTO UpdateUser
:UserCurrent
ECHO user is already current
:UpdateUser
copy "N:\MasterFrontEnd\Master.mdb" "C:\FrontEnd\FrontEnd.mdb
...write a new username.upd in the UserUpdate folder
...start the FrontEnd.mdb
ECHO user is now current
=======================
I just need help with determining the username so I can check for as well as
write the dummy username.upd file.
Graham R Seach - 21 Nov 2004 07:41 GMT
I assume you're talking about the Windows domain username. If so, try one of
the following in VBA:
http://www.pacificdb.com.au/MVP/Code/GetLoginName.htm
http://www.pacificdb.com.au/MVP/Code/UserInfoClass.htm
If you're talking about the Access username, then this should do:
sMyUser = Access.CurrentUser
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
>I once got help writing a script that referenced the username
> to determine whether or not to copy a MASTER.mdb to
[quoted text clipped - 29 lines]
> as
> write the dummy username.upd file.