requery of subform within a subform

sal

Registered User.
Local time
Yesterday, 19:15
Joined
Oct 25, 2009
Messages
52
I have a subform on a tab that will requery when exiting the first data entry page.

But I have a subform within a subform on another page that generates a runtime error (Object doesn't support this property or method) with the code I am currently using. I have tried to follow syntax for referencing a subform within a subform but something is wrong.

Poor naming conventions aside, here is my code:

Private Sub SGS_Survey_Form_Exit(Cancel As Integer)
Forms![SGS App Form].[Child241].Form.Requery
Forms![SGS App Form].[STHD Data Select].[STHD_Project_Data_Export_SF].Form.Requery

End Sub

This does not work either:

Form![SGS App Form].Form![STHD Data Select].[STHD_Project_Data_Export_SF].Form.Requery
 
Forms![SGS App Form].[STHD Data Select].Form.STHD_Project_Data_Export_SF].Form.Requery

Also, make sure you are referencing the name of the subform controls and not the subform names themselves unless they are both named the same.
So if Child24 is the name of the subform control, you also use it here. And the same with the one on the subform.
 
Thank you.:)
 

Users who are viewing this thread

Back
Top Bottom