Display the primary key(s) automatically in new record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a company table with a primary key of comp id (text) and an activity
table with primary keys compd id and activity id (autonumber). When I click
on a button in a form that displays a company, the activity table is
displayed with just the activities for that company. How can I get the comp
id to automatically display in the compd id field of the activity table so a
user does not have to enter it?
Thanks,
J.
 
It sounds like you have not set the Master/Child links between the main form
and the subform.
 
I have a company table with a primary key of comp id (text) and an activity
table with primary keys compd id and activity id (autonumber). When I click
on a button in a form that displays a company, the activity table is
displayed with just the activities for that company. How can I get the comp
id to automatically display in the compd id field of the activity table so a
user does not have to enter it?
Thanks,
J.

Use a Form based on the company table, with a Subform based on the
activity table; use the comp id as the master and child link field.

There's no need to even display it; generally autonumber ID's should
be kept "under the hood" and not exposed to users.

John W. Vinson[MVP]
 
Thanks John. I don't want to display the ID, but I want to make sure the
field is populated before hiding it. Thanks, again.
J
 
Hello:
If I already have a subform attached to the company form, how can I use a
button to open the activity form?
Thanks,
J.
 
Back
Top