C
Clint Marshall
I have two tables - tblMember and tblAddress. tblAddress has two records
for every person in tblMember - a summer address and a winter address
(denoted by S and W in the "season" field of tblAddress). tblMember has an
Autonumber field for its primary key (MemberID). It is linked with
referential integrity to tblAddress. The key in tblAddress is a combination
of MemberID and the season field (either an S or a W).
The goal is to combine data from tblMember with BOTH the appropriate S and W
records of tblAddress in a query so that I can show it all on one form for
updating and adding new members. The only way I've been able to make this
work is to create what I call subqueries sqrySummer and sqryWinter and then
combine the results of these queries with the data in tblMember in a third
query called qryMemberWAddress. This had some troubles early on that I
could only resolve by making the Recordset Type be "Dynaset (Inconsistent
Updates)".
Now I find that I can update any addresses that already exist, but when I
try to add a new member through qryMemberWAddress or the form based on it, I
get an error stating that "You cannot add or change a record because a
related record is required in table tblMember". If I only fill in the
fields that come from tblMember, Access will accept the record. As soon as
I try to enter anything into the fields that come from tblAddress, I get the
message. It would appear that the query knows how to add the record in
tblMember, but doesn't know how to add the records in tblAddress. Even if I
set up the record in tblMember and then try to use the query to enter
data/add records to tblAddress, I get the same error.
I presume this problem originates with trying to pull and combine data from
two records in the same table (tblAddress), but don't know how to fix it.
Should the table structure be set up differently, or is there something I
can do in the query or coding to make it work?
Thanks!
-Clint Marshall
for every person in tblMember - a summer address and a winter address
(denoted by S and W in the "season" field of tblAddress). tblMember has an
Autonumber field for its primary key (MemberID). It is linked with
referential integrity to tblAddress. The key in tblAddress is a combination
of MemberID and the season field (either an S or a W).
The goal is to combine data from tblMember with BOTH the appropriate S and W
records of tblAddress in a query so that I can show it all on one form for
updating and adding new members. The only way I've been able to make this
work is to create what I call subqueries sqrySummer and sqryWinter and then
combine the results of these queries with the data in tblMember in a third
query called qryMemberWAddress. This had some troubles early on that I
could only resolve by making the Recordset Type be "Dynaset (Inconsistent
Updates)".
Now I find that I can update any addresses that already exist, but when I
try to add a new member through qryMemberWAddress or the form based on it, I
get an error stating that "You cannot add or change a record because a
related record is required in table tblMember". If I only fill in the
fields that come from tblMember, Access will accept the record. As soon as
I try to enter anything into the fields that come from tblAddress, I get the
message. It would appear that the query knows how to add the record in
tblMember, but doesn't know how to add the records in tblAddress. Even if I
set up the record in tblMember and then try to use the query to enter
data/add records to tblAddress, I get the same error.
I presume this problem originates with trying to pull and combine data from
two records in the same table (tblAddress), but don't know how to fix it.
Should the table structure be set up differently, or is there something I
can do in the query or coding to make it work?
Thanks!
-Clint Marshall