Enter records from one table to another using a form

G

Guest

Things are much more complex but I will try to be as simple as I can:

I have two tables and one form. I am using the form to enter data in tblData.
The Record Source in my form is based on tblData. My second table is called
tblDefaultUser, which has only one record, the current set default user name.
When I enter a new record using the form I would like to automatically enter
the user name from tblDefaultUser in the new record created in tblData in the
field called User. How can I do this?
 
R

Rick Brandt

Silvio said:
Things are much more complex but I will try to be as simple as I can:

I have two tables and one form. I am using the form to enter data in
tblData. The Record Source in my form is based on tblData. My second
table is called tblDefaultUser, which has only one record, the
current set default user name. When I enter a new record using the
form I would like to automatically enter the user name from
tblDefaultUser in the new record created in tblData in the field
called User. How can I do this?

Set the DefaultValue property of the TextBox on the form to...

=DLookup("UserNameField","tblDefaultUser")
 
G

Guest

Thank you, it works like a charm.

Rick Brandt said:
Set the DefaultValue property of the TextBox on the form to...

=DLookup("UserNameField","tblDefaultUser")
 

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