Access 2002 - Accessing Subform controls

rishi

Registered User.
Local time
Today, 10:29
Joined
Oct 2, 2002
Messages
24
Hi! All,
I am working on Access 2002. I have a tabbed form where i put a subform/subreport control and linked the subform/subreport control to a form (namely "Installed Measures"). The form i have has subforms. I need to access the controls on the subforms. I followed the book on Access 2000 and this was the syntax i used
Forms![Installed Measures]![InstalledMeasures_lampsandballasts].Form![Text16] = Null
...
...
...
(Added more lines to access other controls on the same subform)
I wrote this code on the "On Enter" event of the Tab's subform/subreport control. The "On Enter" event gets triggered when the tab is selected. So on selecting the tab, i get the error saying "Can't find the form Installed Measures". A friend of mine uses the same code in access 2000 and it works fine such that he is able to access subform controls while i can't in access 2002. Is there something different i need to do? Please let me know.
Also i would like to know the difference in syntax for accessing subform controls and subform properties. Hope to get some help. Thanx.

Rishi..
 
The tab on which i put the subform/subreport control is Page58 while the subform/subreport control doesn't really have a name. It currently has the name of the form in the control name.
 
This expression is to be used when wrighting directly in the control source in the property sheet.
When doing this in code, from main form you need:

Forms![Installed Measures]![InstalledMeasures_lampsandballasts]![Text16] = Null

That is:
1 subform:
Forms![Mainform]![subform]![Field]
2 subforms:
Forms![Mainform]![subform]![SecondSubform]![Field]

Hope this helps :-)

rishi said:
Hi! All,
I am working on Access 2002. I have a tabbed form where i put a subform/subreport control and linked the subform/subreport control to a form (namely "Installed Measures"). The form i have has subforms. I need to access the controls on the subforms. I followed the book on Access 2000 and this was the syntax i used
Forms![Installed Measures]![InstalledMeasures_lampsandballasts].Form![Text16] = Null
...
...
...
(Added more lines to access other controls on the same subform)
I wrote this code on the "On Enter" event of the Tab's subform/subreport control. The "On Enter" event gets triggered when the tab is selected. So on selecting the tab, i get the error saying "Can't find the form Installed Measures". A friend of mine uses the same code in access 2000 and it works fine such that he is able to access subform controls while i can't in access 2002. Is there something different i need to do? Please let me know.
Also i would like to know the difference in syntax for accessing subform controls and subform properties. Hope to get some help. Thanx.

Rishi..
 

Users who are viewing this thread

Back
Top Bottom