requery / form_current

  • Thread starter Jan Hummel via AccessMonster.com
  • Start date
J

Jan Hummel via AccessMonster.com

Having 2 unbound subforms nested in a parentform I need to update them
after clicking a button. Using subform.REQUERY I have the wired problem
that each of the childs form_current is executed 2 times.

In the Parrent On_button_click anything is ok, it is only iterated one
time. But Debugging in to the childs Form_Current() shows, that the code is
executed 2 times, giving a delay and a flickering on the screen. The call
stack shows no difference between the 2 invocations.

Are there special events triggert which triggers form_current again?
Setting up a new form with only one subform I could not reproduce this
behavior. But still this double invocation happens I the (productive) forms.

Any help is appreciated.
Jan
 
W

Wayne Morgan

Try turning off the screen echo while you do the requery, then turn it back
on again once you're done.

Application.Echo False
Me.SubformControl1.Form.Requery
Me.SubformControl2.Form.Requery
DoEvents 'give the requeries time to finish
Application.Echo True

This may or may not help, but is worth trying.
 
J

Jan Hummel via AccessMonster.com

Thanks for this hint, I will give it a try. But I think it does not solve
the problem.

Thanks a lot
Jan
 
J

jahu

Thanks again for your attention Wayne,

but as i guest, my problem is still occuring.
And another point I wonder about:
should it not be
Me.SubformControl1.Requery
instead of
Me.SubformControl1.Form.Requery ?

I used the time for a lot of googleing and I found quite a lot of
postings regarding twice triggering / fireing of the form_current
event. May be I should address my question in this direction? But
unfortunately no solutions are given. Only decompiling the database
using "access.exe /decompile mydatabse.mdb" seems worth to give it a
try.

Again, any help is appreciated.
Jan
 
W

Wayne Morgan

should it not be
Me.SubformControl1.Requery
instead of
Me.SubformControl1.Form.Requery ?

The second one is technically correct, but both will work. However, there
are times when you need to specify ".Form" as well when referring to the
subform.
 

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