F
FP1
Can't get an insert to work with linked tables. I need both tables to be
updated with a primary key and matching foreign key on insert. For the
sake of simplicity, I have two tables, tbl1 and tbl2.
tbl1
tbl1_pk primary key
field1
field2
tbl2
tbl2_pk
tbl1_fk foreign key
field3
field4
Without a relationship defined, running a join query on tbl2.tbl1_fk=tbl1
_pk (it's a left out join, tbl1 is left) as record source to a form.
On the form, on an insert, filling any tbl1 value (field1 or field2)
creates a primary key for tbl1 (expected) but ONLY if enter a value for
tbl2 (field3, field4). If I do NOT enter any data into field3 or 4 (tbl2),
the foreign key is not updated, I get a "the Microsoft jet database engine
cannot find a matching record..." message, which is bad. I tried different
join types and constraints, same result.
Is there a simple way to force the tbl2 (outer joined record) to be created
with a foreign key if the other fields in tbl2? (BTW the primary key gets
generated as soon as I enter anything into field3 and exit the control
which seems odd to me)
updated with a primary key and matching foreign key on insert. For the
sake of simplicity, I have two tables, tbl1 and tbl2.
tbl1
tbl1_pk primary key
field1
field2
tbl2
tbl2_pk
tbl1_fk foreign key
field3
field4
Without a relationship defined, running a join query on tbl2.tbl1_fk=tbl1
_pk (it's a left out join, tbl1 is left) as record source to a form.
On the form, on an insert, filling any tbl1 value (field1 or field2)
creates a primary key for tbl1 (expected) but ONLY if enter a value for
tbl2 (field3, field4). If I do NOT enter any data into field3 or 4 (tbl2),
the foreign key is not updated, I get a "the Microsoft jet database engine
cannot find a matching record..." message, which is bad. I tried different
join types and constraints, same result.
Is there a simple way to force the tbl2 (outer joined record) to be created
with a foreign key if the other fields in tbl2? (BTW the primary key gets
generated as soon as I enter anything into field3 and exit the control
which seems odd to me)