OK, it sounds like you have orphan detail records on the
Many side of a One-to-Many relationship with the Master
Table. Is this true?
If so, is it possible that its parent already exists in
the Master table? If so, you can base a form on the Temp
table. Do not include the linking foreign key, but add a
combo box to the form that looks up its values from the
Master table, and has the foreign key field as its Control
Source. If a valid Master exists, you now have valid
records that you can post to the Child table.
If the parent record does not exist, you will need to add
it. One way of doing this is to set the LimitToList
property of the combo box to Yes, and create a procedure
for the OnNotInList event that allows the user to open a
form, which I presume already exists based on the Master
table. Once the new master record has been added, you
will need to Requery the combo box to allow the user to
choose this value for the detail record.
Are we getting closer?
HTH
Kevin Sprinkel
-----Original Message-----
Dear Kevin I appreciate your help. My task is: I have
master table (for example MatserTable) and ChildTable.
There is relation beetwen tables. Also exist code (I have
not to modify this code) that copy data from another
format into TempTable (with the same structure as
ChildTable) and then insert TempTable into ChildTable. But
there ara errors key violations. So before append I think
to make select query (TempTable and MasterTable) to
determine missing keys in MasterTable and allow user to
enter missing data in MasterTable and then execute
existing code to append Temptable into ChilTable. The
problem is I cannot make editable form on query and this
form might has predefined number of rows. All of them must
be entered correctly to avoid key violation in the future.
Your advice to create temp table. Is this good. sorry for
bad english.