Re: Accessing data from a subform in the parent form's recordset
- From: "Jeanette Cunningham" <nnn@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 29 Mar 2008 08:43:26 +1100
Pat,
with a form subform setup, put the record ID on the parent form in a textbox
control.
Also put the recordID which is the foreign key on the child subform on the
subform in a textbox control.
The link master fields will be firearm_id and the link child fields will be
weaponid.
That is assuming that there is a one to many relationship between firearms
table and the weapons table and the tables are joined on that field.
This means in the relationship window, that you click on the firearm_id and
drag and drop it on the weaponid in the weapons table.
Setting up the link master fields and link child fields lets access manage
all the work to save the main form record before you add new child records.
Jeanette Cunningham
"Pat" <Pat@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D06B6844-AC3E-4F3F-9837-D005F7E2FD26@xxxxxxxxxxxxxxxx
I have a field in the main DB that is the record ID (autonumber) which is
not
displayed on the parent form. But because I have a table relationship
setup
with the child table I need to access this field from child form when
inserting records into the child DB. It works if the record is existing
and
being edited, but on a insert into the main table it will not be visable
to
the child.
I am opening the parent form in Add Mode with the following syntax:
DoCmd.OpenForm "frm_ModifyFirearms", acNormal, , , acFormAdd, acDialog
The field in the main db is firearm_id. The field in the child DB is
weaponid. The subform does have the fileds linked on the parent form.
I hope I made some since of this question. I am new to Access and VBA.
Thanks in advance....
.
- Follow-Ups:
- References:
- Prev by Date: Re: open multiple forms sequentially
- Next by Date: Re: Data Order De-organize
- Previous by thread: Accessing data from a subform in the parent form's recordset
- Next by thread: Re: Accessing data from a subform in the parent form's recordset
- Index(es):
Relevant Pages
|