Auto Pop fields in a new record

T

twalsh

Ok, slowly learning more about all of this...

I have a form featuring Employee Profiles (attached to tblProfiles) that is
filtered down to a single employee.
I have a command button that opens a new form to enter a Time Clock Issue
which is attached to a different table (tblClockIssues)
The common fields are "Employee ID" "First Name" "Last Name" and "Badge ID".
So now when i click the command button the form opens and jumps to a new
record. I want the fields listed above to auto populate since the profile
form is already filtered down to a single employee. If i can just
auto-populate one field, i can run an update query for the rest i'm sure.
 
T

twalsh

wow, sooo figured this one out on my own. Just set the default values of the
fields on the Clock Issues Form to the matching fields on the Profile Form,
it works because the Profile form will always be filtered down to one agent...
 
A

Arvin Meyer [MVP]

You only need to populate 1 field, the ID which is the primary key. Once
you've done that you NEVER need to duplicate information already stored in
the tblProfiles. Let that sink in for a bit, I emphasized NEVER for a
reason. In a relational database you only store non key data once.

To populate the second form's new record, use the default value property, to
read the data from the first form, like:

=[Forms]![Form1]![txtEmployee ID]

When you open the form from the first form, opening it to a new record,
i.e.:

DoCmd.OpenForm "Form2", , , , acFormAdd

and the Employee ID control will have the value from Form1 populating it by
default.
 

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