Current User (1 Viewer)

aftershokk

Registered User.
Local time
Today, 06:32
Joined
Sep 5, 2001
Messages
259
Hi, I am using Access 2010 and Windows XP.

I have a form named MasterForm and a subform linked into the MasterForm named history_subform

I am tring to get this to work like in 2003

Set Value Item = [Forms]![MasterForm]![history_subform].[Form]![LastUser]
Expression = GetUser()

Gives me an error that action or function cannot be found by Access....

I could swear this used to work in 2003....

thanks!!
 
Last edited:

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:32
Joined
Aug 30, 2003
Messages
36,133
To my knowledge GetUser is not a built in function. You may be thinking of CurrentUser(), which will return the user if you're using Access Security.
 

AlexHedley

Registered User.
Local time
Today, 06:32
Joined
Aug 28, 2012
Messages
171
You could create your own function and use

=Environ("username")

To get the currently logged in Windows user.
 

aftershokk

Registered User.
Local time
Today, 06:32
Joined
Sep 5, 2001
Messages
259
I just tried currentuser and get this error

You tired to run a vb procedure that improperly references a property or method of an object?
 

aftershokk

Registered User.
Local time
Today, 06:32
Joined
Sep 5, 2001
Messages
259
Is there something wrong with the way I call-out the subform?

Set Value Item = [Forms]![MasterForm]![history_subform].[Form]![LastUser]

nothing seems to work
 

aftershokk

Registered User.
Local time
Today, 06:32
Joined
Sep 5, 2001
Messages
259
The name of the subform is HistorySubForm
and its source is named HistoryForm

The field I am trying to update control source and name is User
thanks
 

aftershokk

Registered User.
Local time
Today, 06:32
Joined
Sep 5, 2001
Messages
259
I got it! thanks!

I used the code from pbaldy via the link!

thanks so much!
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:32
Joined
Aug 30, 2003
Messages
36,133
Happy to help!
 

Users who are viewing this thread

Top Bottom