Access Hide all subforms
Posted: 13 Apr 2009, 17:06
OK, so i have a main form with several subforms on. No data is linked. I have a Command button for each subform which when clicked must either inhide or hide a specific subform. I want each form to only show if i click its corresponding command button. Currently i have to fist click to show a subform then click same command button again to hide said subform before i click another button for another form.
I am looking for a function that can be called from each buttons OnClick event to first check and see if any subforms are visible and if so to hide them beor opening the subform i am currently selecting. I have found many for next loops for controls on the net but none for Subforms. the code i have tried tends to want to close all forms that are visible and not just the subforms that are on the current form.
another solution would be to have the button open a pop up form set to modal, but i want each form to open to a specific size and position on the screen. this i have not managed to do yet.
please can some one help. a solotuion to my first option would be great.
I am looking for a function that can be called from each buttons OnClick event to first check and see if any subforms are visible and if so to hide them beor opening the subform i am currently selecting. I have found many for next loops for controls on the net but none for Subforms. the code i have tried tends to want to close all forms that are visible and not just the subforms that are on the current form.
another solution would be to have the button open a pop up form set to modal, but i want each form to open to a specific size and position on the screen. this i have not managed to do yet.
please can some one help. a solotuion to my first option would be great.