By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,471 Members | 2,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,471 IT Pros & Developers. It's quick & easy.

update records in child table based on value in parent table

P: n/a
Tom
hello
i have 2 tables linked by a common id. The first table has records
with a specific field with numeric values. eg 3 or 6 or 10 etc. What i
want to happen is when i create a data entry form, i can scroll thru
each record and when a value such as 6 comes along, the second/child
table allows for 6 records to be created based on the same unique id
using a data entry form
eg
table 1
id 6
value 6

table 2
id 6 "data entry"
id 6 "data entry"
id 6 "data entry"
id 6 "data entry"
id 6 "data entry"
id 6 "data entry"

How can i do this
thanks
tom
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Perhaps you could use the recordset object, and iteration, for/next to add
the six new records to table.
You will probably need a trigger (button) to call the routine after you have
stopped at the record on the parent table/form.
This will then run you code to populate the foreign key (id) of the second
table.

code might look something like....

sub MyButton_click()

dim rs as recordset
dim db as database

set db=currentDb
set rs=db.openrecordset("Table2",dbopendynaset)

with rs
for i= 1 to 6
!id=IdTextBoxOnForm
end with

end sub

"Tom" <ge*****@yahoo.com> wrote in message
news:bf**************************@posting.google.c om...
hello
i have 2 tables linked by a common id. The first table has records
with a specific field with numeric values. eg 3 or 6 or 10 etc. What i
want to happen is when i create a data entry form, i can scroll thru
each record and when a value such as 6 comes along, the second/child
table allows for 6 records to be created based on the same unique id
using a data entry form
eg
table 1
id 6
value 6

table 2
id 6 "data entry"
id 6 "data entry"
id 6 "data entry"
id 6 "data entry"
id 6 "data entry"
id 6 "data entry"

How can i do this
thanks
tom

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.