I have a tab form called Home and I would like to say for example refresh another form loaded in one of the tabs (or the current one).
I tried the following: [Forms]![Home].[Form]![AnotherForm].[Form].Refresh
But no joy – what is the correct syntax?
or (alternative syntax):
Some clarification:
If you want to access the subform programmatically, you have to use the name of the subform control, not the name of the nested subform itself!
Homeform, or in a tab control. You always use the names of the form and of the subform control, you don’t need the name of the tab control.The solution is even shorter when the code that does the refresh is directly in the
Homeform:EDIT:
I just noticed that I used
Requeryinstead ofRefreshin my answer (probably because I read ChrisPadgham’s answer before where he suggests usingRequery).You can call both
RequeryandRefreshusing the syntax shown above.Which one to use depends on what you want to do:
Requeryif you want to re-load the data source of the formRefreshif you want to re-load the form itself, i.e. refresh the controls