Full Version: Viewing The Window Of A Subform In Design Mode
UtterAccess Forums > Microsoft® Access > Access Forms
datamine
I have researched this and it's actually hard to know exactly what keywords may help me find a solution
so apologies if this has been asked and answered.

I have one form. It contains many subforms. When I view this form in design mode, all subforms come up
(of course). I need to be able to see one directly so I can size its window and/or reposition it. Is there
a way to single out one particular subform so that it is directly on top of all of the others for the moment
in design mode?

I know how to highlight its window and I can modify using the property sheet - but cannot see what size
would be best because all other subforms are on top of it.
theDBguy
Hi. Are you saying you want to stack/overlay each subform on top of each other so that the user only see one subform at a time? If so, you could possibly just use one subform control and just dynamically change what it contains using code during runtime.
ScottGem
In the Property dialog is a pull down list listing all the controls and other objects. Select the name of the subform from that list and it will become the active subform. If that doesn't bring it to the front, use the Arrange ribbon to bring to Front.

You might want to consider a Tab control to organize the subforms or what DBGuy suggested.
datamine
No, nothing to do with users. I am just trying to view a subform among many in design mode. I cannot see it in design mode due to all subforms coming up at the same time when in design mode - they are coded to come up one at a time for the users so no problem - but in design mode it seems that anything inside of the parent form pops up and some of the other subforms get in the way.
datamine
Thanks for the suggestions. Unfortunately, have tried them - selecting via property sheet as well as 'bring to front'. Neither work. That's the extent of my knowledge, i.e., I don't know what DBGuy means. Also, if it takes more than just a couple of minutes then it may be more efficient for me to just simply guess at the size of the subform window then view in form view and if that is not great go back to design view and guess again.
ScottGem
It may not bring the window to the front, but it will select it. You can then adjust Height and width in the Properties dialog. Have you looked at using a Tab Control?
theDBguy
>>I don't know what DBGuy means.<<
I mean, if you're only allowing one subform to be viewed at a time during normal operations, then you can change your form's design to only have one subform when you're in design view. Then, when the user views the form normally, you can use code to switch the forms that show up in the subform area. Does that make sense?
ScottGem
A subform is a control on your form. The Subform control has a Source property, which is the name of the form displayed in the control. If you have a lot of subforms, it can cause memory problems. If you are only displaying one subform at a time you can use one control and change the Source property to display different forms. That's what DBGuy was referring to.
datamine
I appreciate the further explanations. I suppose I would need to see an example. There are over 40 subforms. About 20 of them are in one form and the other half are a subform within a subform. I couldn't imagine this would be good practice but it is an inherited db.

Any chance of an example in a db that I can take a look at? That is, an example of good practices.

But for the solution to my original problem, I have been doing exactly what you suggested by selecting it, blindly adjusting the window, then getting out of design view and viewing the results in form view. If needed, repeat.
ScottGem
I don't think an example would help. I can tell you I dealt with this a while back where I had a lot of subforms and I was constantly crashing due to memory issues until I changed the app to use a single subform control.

You said;
QUOTE
they are coded to come up one at a time for the users so no problem


It would help to see that code. But I imagine it is something like this:

Me.Currsubformname.Visible = False
Me.NextSubformname.Visible = True

So, instead you can use

Me.singlesubfromname.SourceObject = "formname"

Where formname is the name of the next form you want to appear as the subform. You can maintain a table of forms with the Top, Left, Height & Width values for the particuler form and then adjust the single subform control to fit.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.