Subform combo box choice causes immediate record save

G

Guest

I have a 1:M:M data model, with a form with 2 subforms contained (sf1:sf2).
The problem is that when a new choice is selected in a combo box on sf2 it
seems that an immediate attempt to save the record occurs (I expect the row
to show the updated pencil image) and more data is required so errors occur.
I have a hidden control with the appropriate key for sf2 on the main form.
When I try sf2 by itself it's OK. Thanks for the noodling.
 
A

Allen Browne

What is the RecordSource of sf2?

If it is a query that contains more than one table, you may have struck an
Access bug. For example, if this query contains the table you want to save
to plus a lookup table, and there is a Default Value set in one of the
fields of the lookup table or one of the fields bound to the lookup table,
Access attempts to assign this default value to the lookup table. This
attempt fails, because you are not actually saving a record to the lookup
table. Removing the Default Value should solve this issue.

If that is not the issue, we need to simplifiy the scenario to eliminate
some factors. For example, check what is in the Link Master Fields and Link
Child Fields properties of the subform controls, temporarily comment out any
code in the module of sf2 (particularly the AfterUpdate of the control and
the BeforeInsert of the form), and check the Tab Order (View menu) to ensure
the field is not wrongly assigned as the last one in the order.
 
G

Guest

Solved, thank you for your prompting. The Link Master and Link Child property
(name BWNo) on sf2 was in a hidden control named BWNo on the main form which
was being populated correctly, and was in the query for sf1, but wasn't
actually ON sf1. When I placed BWNo on sf1 all seems OK but needs more
testing.

ps. I lived in Wollongong for 3 years many years ago. Again thanks.
 

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