Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 start up forms

Status
Not open for further replies.

lasitha

Programmer
Jun 7, 2003
38
LK
Hi All,

I have 2 start-up forms. I want to pop-up one form according to logon user. Is it possible to do this through the vba code?

Thaking you all,

Lasitha.
 
Hi

Yes

Actual vba code depends on if you are talking about the Users Network Login id, or their Access (security) log in

For Access login id you can use CurrentUser() - but this is only practical if you have implemented Access Security, or at least the log in portion of it, otherwise it will always return "Admin"

If you want Netork login id see
Basically what you need to do is to set your start up options to run some code

the outline of what you need in that code is

If CurrentUser() = "A UserId" Then
' open form 1
Else
' open form 2
end If

in practice if you have several users and / or to make it so that adition of new users or removal of old users does not require changes to the code, you may wish to consider havinga table which lists the users and tells you which start up form is applicable to them. Then look up the user in the table and open the appropriate form


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top