Requery Subform

  • Thread starter Thread starter tobesurveyor via AccessMonster.com
  • Start date Start date
T

tobesurveyor via AccessMonster.com

Good afternoon:

I have a form (frmScheduler) which has a subform (subfrmCalendar).
subfrmCalendar has several subforms named (subfrmCrew1Day1, subfrmCrew1Day2,
subfrmCrew2Day1, subfrmCrew2Day2)

On the main form when ever an action is done I have a routine that requeries
the subfrmCalendar, as in: Forms!frmScheduler!subfrmCalendar.Requery

This updates the data for all the subfrmCrew1Day1, subfrmCrew1Day2...ect.

I am now making an update to these set of forms where I am going to display
different data (the greater the number of records shown on subfrmCrew1Day1,
the less information the subform will give. In this I have changed
subfrmCrew1Day1 to subfrmCrew1Day1_3r, subfrmCrew1Day1_2r, and
subfrmCrew1Day1_1r). Right now I have the determination based upon a DCount
on the On_Open event on the subfrmCalendar. However I am finding that if the
criteria changes on the frmScheduler and I call the routine for the Forms!
frmScheduler!subfrmCalendar.Requery, since the subfrmCalendar is already open,
it will not run the Dcount again.

My question is what events can be utilizied on the subfrmCalendar when I call
a requiery on the main form frmScheduler?

Any thoughts would be greatly appreciated.
Thanks,
Chris
 
Are you storing this calculation?
If so, you shouldn't. Calculations should really be done on the form or in
queries.

In that case, you would just use the calculation as the ControlSource.

If you really want to set the value in code (because you are storing it) put
your DCount() in a function. you can then call that function in your OnOpen
event and along with your Requery.

If possible, you could place the DCount() and Requery in a function, then
one line of code would call both.

Steve
 
Back
Top