I have a MainForm/subform1/subform2 setup that I thought
was working but maybe I just hadn't tested it enough or
broke it as I added more features. The database has 2 main
tables: Companies and AgreementHistory. On my MainForm I
get the CompanyName from the Companies table. For subform1
I get the AId, and 3 date fields plus a calculated field from
a query based on the AgreementHistory table linking it to MainForm
using CompanyName. For subform2, I get the remainder of the
fields(12 total) also from the AgreementHistory table.
Subform1 and 2 are linked by the AId. Subform1 is
a continuous view form and the idea is that for the
current record you will see the details in subform2. The
OnCurrent code for subform1 is Me.Parent!
[subform2].Requery. When I add a new record in subform1 I
have a hidden control that sets focus to subform2 but when
I try to save details in subform2 I get a ".changes would
create duplicate values." error. If I click on another
record in subform1 or close the form I can come back and
enter the details into subform2.
Is it the Requery action that's causing me problems and
should it maybe not be activated for a new record or maybe
not on the OnCurrent event. Or worse, are my tables set up
wrong.I really need some assistance and my VBA skills are limited!
Thanks in advance.