Auto update combo

J

Jean

Anyone help with the following problem.
combo10's data source is set to a query. The query has a
parameter, which is linked to a control on the same form.
When a control box on the form (a date field is updated)
combo10's record source parameter is changed. I have tried
many different ways to get combo10 to reset itself and
pick up the new data. Without success. Unless the date
field is updated manually and the controls exit event is
set to.

Me.Combo10.Visible = False
Me.Combo10.Requery
Me.Combo10.Visible = True

Why can I not achieve the same result in the after update
event on the date field.
Thanks Jean
 
G

Graham Mandeno

Hi Jean

This should work from the AfterUpdate event, and that is more appropriate
than the Exit event, because the exit event will fire if the user just tabs
through the date field without changing it.

The Visible=False/True is unnecessary and will probably give some annoying
screen flicher. Just use:
Me.Combo10.Requery

Remember that AfterUpdate fires only after a manual change of the field. If
you change the field value in code you must call the AfterUpdate procedure
yourself. Same applies if the date filed is bound and you navigate to a new
record. Put either:
Call txtDateField_AfterUpdate
or
Me.Combo10.Requery
in your Form_Current event procedure.
 

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