C
Cyberwolf0000 via AccessMonster.com
I have a table that has data entered in 2 ways. One way is when it is
entered on a subform of another form. The other is a stand-alone form. The
underlying table structure is as follows:
ReasonCodes - ReasonCodeID(PK)
RPPCauseInfo - RPPCauseInfoID(PK) - ReasonCodeID(FK)
I have a one-to-many relationship between ReasonCodes(One) and RPPCauseInfo
(Many).
When data is entered via the subform everything works fine. But, when I have
the stand-alone form open, I have Code that adds a record to the ReasonCodes
table using a SQL INSERT INTO statement. The record gets added fine, but
when I go to move away from the record I get an error "The Microsoft Jet
database engine cannot find a record in the table 'ReasonCodes' with key
matching field(s) 'ReasonCodeID'" I have tried doing a requery on the form
but that did not help. I believe it is because of the One-To-Many
relationship. That is why I add a record to the ReasonCodes table to enforce
the integrity. Is there a way to requery the ReasonCodes table so that the
record is recognized?
Can anyone tell me why this happens?
--
James B Gaylord
For the Wolf comes the strength of the Pack,
For the Pack comes the strength of the Wolf,
-R. Kipling
Office 2003 on Win XP SP2
entered on a subform of another form. The other is a stand-alone form. The
underlying table structure is as follows:
ReasonCodes - ReasonCodeID(PK)
RPPCauseInfo - RPPCauseInfoID(PK) - ReasonCodeID(FK)
I have a one-to-many relationship between ReasonCodes(One) and RPPCauseInfo
(Many).
When data is entered via the subform everything works fine. But, when I have
the stand-alone form open, I have Code that adds a record to the ReasonCodes
table using a SQL INSERT INTO statement. The record gets added fine, but
when I go to move away from the record I get an error "The Microsoft Jet
database engine cannot find a record in the table 'ReasonCodes' with key
matching field(s) 'ReasonCodeID'" I have tried doing a requery on the form
but that did not help. I believe it is because of the One-To-Many
relationship. That is why I add a record to the ReasonCodes table to enforce
the integrity. Is there a way to requery the ReasonCodes table so that the
record is recognized?
Can anyone tell me why this happens?
--
James B Gaylord
For the Wolf comes the strength of the Pack,
For the Pack comes the strength of the Wolf,
-R. Kipling
Office 2003 on Win XP SP2