D
Debris
Hello,
I have a simple database to track my CD collection -- two tables, tbl_Albums
and tbl_Artists.
Tbl_Artists contains one field, the artist name, and that field is the
primary key. Tbl_Albums contains an AutoNum field for the primary key, the
album name, the associated artist, and some other data. In my Relationships
I have Referential Integrity enforced between the two tables.
I'm trying to make a form and subform. The parent form displays one field,
the artist name, in a combo box. The child form displays the albums
associated with that artist. I built both forms "by hand" -- no wizards
(well, the form/subform wizard).
So the form opens, but when I close/save I receive the following:
The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or relationship.
(Error 3022)
I think I understand the error message -- the database is trying to save the
artist name in tbl_Artist, and that name already exists.
But I *think* the bigger problem is that I'm trying to save the artist name
back in tbl_Artist, and I should be saving it in the associated field in
tbl_Albums. And therein lies my problem, and frankly I don't know what to
try next. Is there a way to use a combo box to look up a value in one
table, and store it in another...?
Any help is appreciated. Thanks,
D
I have a simple database to track my CD collection -- two tables, tbl_Albums
and tbl_Artists.
Tbl_Artists contains one field, the artist name, and that field is the
primary key. Tbl_Albums contains an AutoNum field for the primary key, the
album name, the associated artist, and some other data. In my Relationships
I have Referential Integrity enforced between the two tables.
I'm trying to make a form and subform. The parent form displays one field,
the artist name, in a combo box. The child form displays the albums
associated with that artist. I built both forms "by hand" -- no wizards
(well, the form/subform wizard).
So the form opens, but when I close/save I receive the following:
The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or relationship.
(Error 3022)
I think I understand the error message -- the database is trying to save the
artist name in tbl_Artist, and that name already exists.
But I *think* the bigger problem is that I'm trying to save the artist name
back in tbl_Artist, and I should be saving it in the associated field in
tbl_Albums. And therein lies my problem, and frankly I don't know what to
try next. Is there a way to use a combo box to look up a value in one
table, and store it in another...?
Any help is appreciated. Thanks,
D