In desperate need of help

A

an

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, ActiveDate, and ExpirationDate from the
AgreementHistory table linking it to MainForm using
CompanyName. For subform2, I get Requestor, RDepartment,
ContactName, ContactNumber, ContactEmail, Comments and
several other fields also from the AgreementHistory table.
Subform1 and 2 are linked by the AgreementID. 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. I really need some assistance
and my VBA skills are limited!
 
A

an

The source for subform2 is a query off the table because
of a calculated field. Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top