Connecting Tech Pros Worldwide Help | Site Map

form combo boxes giving duplicate record error

akhenaton
Guest
 
Posts: n/a
#1: May 7 '07
I have 6 tables total, 5 of them have two fields, ID and name, like
so:

Table1 (ID1, name1)
Table2 (ID2, name2)
....
Table5 (ID5, name5)

The last table is an intersection table that brings in all the 5
tables IDs with a 1:M relationship to each table like so:

IntersectTable (ID1_FK,ID2_FK,ID3_FK,ID4_FK,ID5_FK)

Now I built a form and a subform that enables me to view all the
combinations entered in the IntersectTable by name. I want the
functionality to update the Intersect table by adding new records but
everytime I run into an update error thats says I'm trying to create
duplicates.

I use lookup combo boxes for all 4 fields in my subform, here's the
detail behind one of them:

Control Source: ID2_FK
Row Source: SELECT ID2, name2 FROM Table2 ORDER BY [name2];
Bound Column: 1

I am unclear as to what is creating this duplicate error as what I
intend to do is only update the IntersectTable where I have put all
fields as none indexed and where there is a separate Autonumber field
as the primary key.

akhenaton
Guest
 
Posts: n/a
#2: May 7 '07

re: form combo boxes giving duplicate record error


Actually I just solved this error I was having. For reference, I built
a single form and noticed it worked fine ith only one form. So I
figured the problem was with my reference between the form and the
subform. I changed the reference in the subform child field from ID1
to ID1_FK (referencing my intersect table instead of Table1). I don't
get my error anymore...


I guess writing my issue down helped clear my thoughts up as I had
been stuck on this for a while now..Thanks :)


Closed Thread


Similar Microsoft Access / VBA bytes