requery subform automatically

  • Thread starter Thread starter magmike
  • Start date Start date
M

magmike

In this drama, there resides the following characters:

Main form: [Rawleads]
Nothing much to say, it's the main form visible at most all times. This
database is for contact management.

Pop-up Form #1: [CallBacks Add]
Users click a button on the main form that opens a pop up form that allows
them to 'schedule' a 'call back' (or to-do item) for this contact. Call
Backs are stored in a seperate table related to the record currently in view
on the main form.

Pop-up Form #2: [CallBacks View]
Same as above, but this pop up form views 'call backs' currently scheduled
for this contact.

Subform: [Rawleads Date Count]
Backed by a query that list dates that have 'call back' records and displays
a count of how many call backs are schedule for each date. This query and
counts are for all contacts, not just the one currently in view on the main
form (this allows the user to see if there are too many call backs scheduled
for a particular day, and gives them more power when scheduling a call back
item).

Now - the plot thickens....

The thickening happens during a user's visit to either of the pop-up forms.
When making date changes in current 'call backs' or adding new one's, it is
desirable of course, to have the 'date count' subform update itself
automatically, at a minimum, when the main form (which also displays the
'date counting' subform) comes back into view. The only way I have been able
to acheive this as of yet, is by adding a button to the subform that
requeries it. However, a manual effort, of course, is required for the
update to show. A similar button on the main form that 'refreshes' the main
form, also acheives a visual update to the date count - with a manual
effort, however.

Can any of you geniuses finish this script by showing me a way to acheiving
a requery of the subform once either of the pop-up forms are closed and/or
the main form comes back into view?

Thanks a million in advance!
Mike
 
magmike,
As long as the Main and Sub are still open on Pop-up Close event...
Forms![Rawleads]![Rawleads Date Count].Form.Requery
should do it.
 
Worked great, thanks!

Al Camp said:
magmike,
As long as the Main and Sub are still open on Pop-up Close event...
Forms![Rawleads]![Rawleads Date Count].Form.Requery
should do it.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


magmike @netterweb.com> said:
In this drama, there resides the following characters:

Main form: [Rawleads]
Nothing much to say, it's the main form visible at most all times. This
database is for contact management.

Pop-up Form #1: [CallBacks Add]
Users click a button on the main form that opens a pop up form that
allows
them to 'schedule' a 'call back' (or to-do item) for this contact. Call
Backs are stored in a seperate table related to the record currently in
view
on the main form.

Pop-up Form #2: [CallBacks View]
Same as above, but this pop up form views 'call backs' currently
scheduled
for this contact.

Subform: [Rawleads Date Count]
Backed by a query that list dates that have 'call back' records and
displays
a count of how many call backs are schedule for each date. This query and
counts are for all contacts, not just the one currently in view on the
main
form (this allows the user to see if there are too many call backs
scheduled
for a particular day, and gives them more power when scheduling a call
back
item).

Now - the plot thickens....

The thickening happens during a user's visit to either of the pop-up
forms.
When making date changes in current 'call backs' or adding new one's, it
is
desirable of course, to have the 'date count' subform update itself
automatically, at a minimum, when the main form (which also displays the
'date counting' subform) comes back into view. The only way I have been
able
to acheive this as of yet, is by adding a button to the subform that
requeries it. However, a manual effort, of course, is required for the
update to show. A similar button on the main form that 'refreshes' the
main
form, also acheives a visual update to the date count - with a manual
effort, however.

Can any of you geniuses finish this script by showing me a way to
acheiving
a requery of the subform once either of the pop-up forms are closed
and/or
the main form comes back into view?

Thanks a million in advance!
Mike
 
Back
Top