Update Table with User Name

C

C#''er

I have created a form (on the FE) that is linked to a table (on the BE). In
this form there are a number of fields, one of which uses a Macro that
returns the network login name of the user. However, the value in this text
box is dosent update inside the table. How can I get this value stored in the
table I am using?
 
A

Albert D. Kallal

Just put the code in the forms before update event.. (it only fires if the
form data is changed).

So,

me!Username = nameOfFunctionThatReturnsUserNameGoesHere()
 
C

C#''er

Im sorry, I failed to mention that I am somewhat of a novice using Access to
code. I did try your suggestion though, but to no avail. The "Recieved By"
columm in the table still does not update with the user name (function name
is "username()"
 
R

Rockn

You will need to bind the text on the form to the table field if this is a
bound form. Otherwise there is code behind the form that is updating the
table in question and that field is not included.
 
C

C#''er

It is a bound form. Other fields on the form are text entry fields. With
these fields i dont have any problems with the updating of the table. They
are entered into the table just fine. for the other fields on the form I have
the control sorce equal to the matching field in the table. However, as the
control source of the 'recieved by' field, i have a function which returns
the network ID of the current user. This field is never saved onto the table.
 
K

Klatuu

You can do one of two things. You can add a control on the form that is
bound to a field in the form's record source and populate the control with
the user name or you can use a query to update the record.
 
K

Klatuu

Therein lies your problem. A control can have only one control source. To
update to the table, it needs to be bound to a field in the table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top