Inconsistent behavior when requerying to update a control

D

Dan Neely

I have some forms with both a databound combobox/listbox in one sub
form and a second subform to create new rows for the lookup table. In
the AfterUpdate event of the 2nd form I requery the combobox/listbox
in the first. The problem is that in some cases the combo/listbox
lags one record behind the newly created records.

eg I add record Foo in subform2, subform1 doesn't show the new
record. Then I add record Bar in subform2. At this point subform1
shows Foo, but not Bar. If I add a 3rd record Baz, Bar will show up
but Baz is still MIA.

Othertimes subform1 immediately gets the newly added record. eg add
Foo, Foo shows. Add Bar, Bar shows. This is the behavior that I
want.

What I can't do is figure out what's different between the ones that
are working properly and the ones that are not to fix them all.

Me.Parent!SubFormName!CtcEmitterNumberID.Requery
 
R

ruralguy via AccessMonster.com

You are describing clasic symptoms of not saving the record before doing your
requery.
If Me.Dirty Then Me.Dirty = False
 

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