CurrentUser

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
Thanks, this helped and thanks for the suggestion on dropping the text.
Looks nicer now

Greets
Ben
--
Novice


Wayne Morgan said:
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 said:
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
 
Back
Top