A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

CurrentUser



 
 
Thread Tools Display Modes
  #1  
Old December 15th, 2005, 02:09 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default CurrentUser

I'm trying to have my field [ScreenedBy] autofilled when my Combobox
[Screened] is changed by the user.

I tried with this expression...
OnChange - Screened
=[ScreenedBy]="Screened by " & CurrentUser() & " " & Now()

But nothing happens... Important for me cause I'm trying to do such things
on more places.

Thanks,
Ben

--
Novice
  #2  
Old December 15th, 2005, 02:38 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default CurrentUser

You may want to use the AfterUpdate event of Screened instead of the Change
event. Also, this will be VBA code. You don't enter it directly into the
Properties tab where is says "On Event Name". Instead, you set the event
to [Event Procedure] then click the ... button to the right of the box to
open the VBA editor at that event.

I probably wouldn't include the words "Screened by" in what I stored,
instead I would let the label for the ScreenedBy textbox say "Screened By"
and the value in the textbox would just be the data. Doing that, the code
would look like:

Me.ScreenedBy = CurrentUser() & " " & Now()

VBA will probably drop the ()'s.

--
Wayne Morgan
MS Access MVP


"Ben" wrote in message
...
I'm trying to have my field [ScreenedBy] autofilled when my Combobox
[Screened] is changed by the user.

I tried with this expression...
OnChange - Screened
=[ScreenedBy]="Screened by " & CurrentUser() & " " & Now()

But nothing happens... Important for me cause I'm trying to do such things
on more places.

Thanks,
Ben

--
Novice



  #3  
Old December 15th, 2005, 03:36 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default CurrentUser

Thanks, this helped and thanks for the suggestion on dropping the text.
Looks nicer now

Greets
Ben
--
Novice


"Wayne Morgan" wrote:

You may want to use the AfterUpdate event of Screened instead of the Change
event. Also, this will be VBA code. You don't enter it directly into the
Properties tab where is says "On Event Name". Instead, you set the event
to [Event Procedure] then click the ... button to the right of the box to
open the VBA editor at that event.

I probably wouldn't include the words "Screened by" in what I stored,
instead I would let the label for the ScreenedBy textbox say "Screened By"
and the value in the textbox would just be the data. Doing that, the code
would look like:

Me.ScreenedBy = CurrentUser() & " " & Now()

VBA will probably drop the ()'s.

--
Wayne Morgan
MS Access MVP


"Ben" wrote in message
...
I'm trying to have my field [ScreenedBy] autofilled when my Combobox
[Screened] is changed by the user.

I tried with this expression...
OnChange - Screened
=[ScreenedBy]="Screened by " & CurrentUser() & " " & Now()

But nothing happens... Important for me cause I'm trying to do such things
on more places.

Thanks,
Ben

--
Novice




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Currentuser Form & Calculations JBL General Discussion 2 November 13th, 2005 03:51 PM
CurrentUser Code Ofer Using Forms 4 November 7th, 2005 01:33 AM
Currentuser () as default value in table? John Nurick New Users 0 October 9th, 2004 07:56 PM
CurrentUser() does not work in query (Access 2003) James Brake Running & Setting Up Queries 1 September 14th, 2004 04:29 PM


All times are GMT +1. The time now is 01:49 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.