Prevent unintentional subform records

G

Guest

I think this is a simple issue and I am just having a brain
freeze......searched around for this identical Q/A on this area but couldn't
find one based on the subject titles I see........

When my form opens (and/or when one changes the combo box that controls the
record displaying in the form/subform) the subform is opening to new record
and creating a record....even though no data is being entered.

So if someone selects a value using the main form's combobox - -call this
"X" and changes their mind and reselects a different value in the combobox -
- - call this "Y"......and they do their thing with the form/subform...all is
fine.....but when I go and look at the table for the underlying subform there
is a record created linked to the "X" ....

At first I thought the issue was because my underlying subform's table had
default values as a property for some fields - since this unintended record
had nothing but these default values....but I eliminated that feature and am
still getting blank records unintentionally....

So am thinking this is a dirty management issue but haven't solved it....

I do think I want the subform to go to new record as it's design so I
haven't really considered stopping this approach....but humans surely will
accidently select the wrong item from the combobox so I need to suppress
these accidental records being entered into the subform's table....

b.t.w. the subform is based on a query of the subform's underlying
table...not sure if this is relevant....Access2003
 
G

Guest

ok - brain unfrozen - sorry for the question.....

I had vb code in the 'OnCurrent' of the subform that was writing a value
from the main form into one field of the subform - thus generating the new
record...

I need that value but moved the code to the 'AfterUpdate' of a subform field
- now if one changes the combobox without ever entering anything into any
field of the subform there is no unintentional record.......
 

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