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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |