Link subform ID control

A

alex

Link subform ID control

Using Access ’03…

I have a form with one subform. The subform holds an ID field/control
(called synopsisID) and a textbox for narrative entries (memo datatype
called synopsis).

The main form and subform are properly linked in the Child/Master
field setting (synopsisID to synopsisID).

My question/issue is how to update the synopsisID textbox on the main
form when it’s assigned (by autonum) in the subform.

I tried the after update event of the synopsisID on the subform, but
couldn’t get it to populate the main form. Maybe there’s a better
way.

Thanks,
alex
 
A

Arvin Meyer [MVP]

You have setup the design improperly for the subform table. synopsisID
should be a Foreign Key in that table not the Primary Key. It should be a
Long Integer datatype, assuming that synopsisId in the main table is an
Autonumber.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Link subform ID control

Using Access ’03…

I have a form with one subform. The subform holds an ID field/control
(called synopsisID) and a textbox for narrative entries (memo datatype
called synopsis).

The main form and subform are properly linked in the Child/Master
field setting (synopsisID to synopsisID).

My question/issue is how to update the synopsisID textbox on the main
form when it’s assigned (by autonum) in the subform.

I tried the after update event of the synopsisID on the subform, but
couldn’t get it to populate the main form. Maybe there’s a better
way.

Thanks,
alex
 
D

Daryl S

Alex -

What is in the main form?

Usually the subform is the 'many' in a many-to-one relationship. So if the
item in your main form can have multiple SynopsisID records, then the proper
way to set up the tables is to include the key to the main form record as a
foreign key in the Synopsis table. Adding a new Synopsis would not alter the
record in the main table.
 
A

alex

Alex -

What is in the main form?

Usually the subform is the 'many' in a many-to-one relationship.  So ifthe
item in your main form can have multiple SynopsisID records, then the proper
way to set up the tables is to include the key to the main form record asa
foreign key in the Synopsis table.  Adding a new Synopsis would not alter the
record in the main table.

--
Daryl S











- Show quoted text -

You guys are right; i had an incorrect design...now the foreign key is
automatically updated in the subform
Thanks,
alex
 

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