Refreshing Subform Data

  • Thread starter Thread starter TPG
  • Start date Start date
T

TPG

My Subform contains records containing numerous dates - for example from
12-feb-2002 to the present. The subform selects the dates in a query using
criteria, Between [Forms]![MainForm]![FirstDate] and
[Forms]![MainForm]![LastDate]

The main form contains two fields [FirstDate] and [LastDate].

When I change the dates in the Main Form [FirstDate] and [LastDate] fields,
to fine tune what is displayed in the Subform. What do I have to do to make
the Subform refresh to reflect the new more finely tuned data. At the moment
I can't make it happen.

Many thanks to all in anticipation.

Centaur
 
When I change the dates in the Main Form [FirstDate] and [LastDate] fields,
to fine tune what is displayed in the Subform. What do I have to do to make
the Subform refresh to reflect the new more finely tuned data. At the moment
I can't make it happen.

Requery the subform in the AfterUpdate event of the two textboxes:

Private Sub FirstDate_AfterUpdate()
Me!subMySubformName.Requery
End Sub

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Thank you John

Works a treat - thank you.

Centaur



John Vinson said:
When I change the dates in the Main Form [FirstDate] and [LastDate] fields,
to fine tune what is displayed in the Subform. What do I have to do to make
the Subform refresh to reflect the new more finely tuned data. At the moment
I can't make it happen.

Requery the subform in the AfterUpdate event of the two textboxes:

Private Sub FirstDate_AfterUpdate()
Me!subMySubformName.Requery
End Sub

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top