Display the primary key(s) automatically in new record

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.
 
K

KARL DEWEY

It sounds like you have not set the Master/Child links between the main form
and the subform.
 
J

John Vinson

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]
 
G

Guest

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
 
G

Guest

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.
 

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