Refreshing an listbox

  • Thread starter Thread starter Nick Mirro
  • Start date Start date
N

Nick Mirro

I have a listbox sitting in a subform who's rowsource criteria is the
subform's current record. It lists all "task names" for the parent form
current record.

When I change records in a linked grandparent form, all of the subform
fields update... except the listbox.


I tried: Me![lstAllTasks].Requery

for the subform "on dirty" and "after update"
and requery with full path for the primary control in the
grandparentform.


How can I get the listbox to automatically update when related records in
its form cycle?
 
Got it. Thanks much.


Sandra Daigle said:
You need to use Current event of the subform to requery the listbox.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


Nick said:
I have a listbox sitting in a subform who's rowsource criteria is the
subform's current record. It lists all "task names" for the parent
form current record.

When I change records in a linked grandparent form, all of the subform
fields update... except the listbox.


I tried: Me![lstAllTasks].Requery

for the subform "on dirty" and "after update"
and requery with full path for the primary control in the
grandparentform.


How can I get the listbox to automatically update when related
records in its form cycle?
 
Nick Mirro said:
I have a listbox sitting in a subform who's rowsource criteria is the
subform's current record. It lists all "task names" for the parent form
current record.

When I change records in a linked grandparent form, all of the subform
fields update... except the listbox.


I tried: Me![lstAllTasks].Requery

for the subform "on dirty" and "after update"
and requery with full path for the primary control in the
grandparentform.

Nick,

try this in the main form's OnCurrent event procedure:

Me![MySubformControl]![lstAllTasks].Requery

However, please note: if the listbox depends somehow on the subform
record too, you need a Requery also in the subform's OnCurrent event:

Me![lstAllTasks].Requery

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
 
Back
Top