Update data from previous form?

M

Mike

I have a form (Protocol_IndexFrm --> Protocol_IndexTbl) which requires a
protocol number to be inputted. From this form (Protocol_IndexFrm) the
primary key is "protocol_index" which is a foreign key within a table called
Couples_IndexTbl. When keying in the protocol information into form 1
(Protocol_IndexFrm) the user will have to append a couples information to
this protocol. From the Protocol_IndexFrm there's a button that brings up
the Couple_IndexFrm. But for some reason I cannot get the
Couple_IndexFrm/Couple_IndexTbl to update the foreign keys field. Is there a
way to append this data from form 1 (Protocol_IndexFrm) as soon as its
entered?
 
K

Klatuu

If you use a form/subform structure and set the Link Master Field(s) and Link
Child Field(s) properties of the subform control on the main form this will
happen automatically.
 
M

Mike

Thanks in advance. The issue that I'm having is that the field
(Protocol_IndexID, which is the foreign key in this table) in the
Couple_Index table is not being updated when I'm keying in the data. I have
to manually select the Protocol_IndexID when in datasheet view to get this to
work. Is there something else that you can suggest?
 
K

Klatuu

Are you using a form/subform?
Have you set the link master and link child properties?
 
M

Mike

Hi Dave and thanks for the help. There is only one subform in the
"Couple_IndexTbl" and it is not set, how would I go about setting them up
once I'm in the properties? At the moment that subform which is the
"Protocol_Index" info is set as follows:

Source Object: Table.Protocol_Index
Link Child Fields: Couple Assigment
Link Master Fields: CoupleIndexID

Please bare with me for I'm not proficient in Access, but I'm assuming that
I would have to change it to the following:

Source Object: Table.Protocol_Index
Link Child Fields: ProtocolIndexID
Link Master Fields: ProtocolIndexID

?
 
K

Klatuu

For starters, the Source Object is not a table. It is the name of the form
that you want to be the sub form. That form should have the table that is
the many side of the relationship as it's record source.

If you can answer these questions, I can show you how to set it up:

Name of One Side Table:
Primary key field(s) names of One Side Table:
Name of Many Side Table:
Primary key field(s) name of Many Side Table:
Name of foreign key in Many Side Table that relates to One Side table:

Name of main form:
Name of sub form: (this is the name of the form, not the subform control on
the main form)
 
M

Mike

I'm sorry to be all over the place. I know this doesnt make any sense. For
the most part, the subforms that I"m using are only for display only. And
everything seems to be working exactly how I want, except for one thing.

When in the form "Protocol_Index" the first thing the user inputs is the
protocol number. This number is used in the next form/table which is called
"Couple_Index". The user usually gets to this form right after keying in the
number and pressing a button which then opens the next form (Couple_Index).
Within the "Couple_Index" table, there is a field that reference to the
"ProtocolIndexID" which is a foreign key in this table (Couple_Index). This
field is not getting updated. When the user first inputs this protocol
number in the "Protocol_Index" form, I would like this data to be placed in
the field called "ProtocolIndexID" which is a foreign key in the
"Couple_Index" table.
 

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