Hi Sandra, thanks for the response. What I actually did
was this:
I created a field in the table, called REGISTERED_BY.
To one of the fields, SEARCH_ADDRESS, in the form (Not a
contiuous form, by the way) I attached the following code;
Private Sub SEARCH_ADDRESS_Enter()
REGISTERED_BY = CurrentUser
End Sub
When I enter the SEARCH_ADDRESS field on the form, "Admin"
is entered into the REGISTERED_BY text box, which is just
what I want. However, when I scroll through the rest of
the records, "Admin" has been entered in them as well -
which isn't what I want. I've changed the code to
Me. REGISTERED_BY = CurrentUser
But the same thing happens. Hope this makes it clearer.
Any more ideas? I'd really appreciate some help.
Jim.
-----Original Message-----
Hi Jim,
It sounds like you are using a calculated control to display the current
user on a continuous form. If this is the case then it is also likely that
nothing is getting saved in the table - it's only a display value.
Instead of putting an expression in the ControlSource of the control you
need to bind the Control to a field in the table by putting (or selecting) a
fieldname in the ControlSource. Then in the BeforeUpdate event of the form,
assign the value to the control with a statement like this:
me.txtUserName=currentuser()
--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.
jim wrote:
I would like to return the Current user to a field in a
record. However, when i try this, the current user is
added to that field in every record, not just the current
one. Can anybody help?
.