Multiple subform problems

303factory

Registered User.
Local time
Today, 05:06
Joined
Oct 10, 2008
Messages
136
Hi

On the main form of my software I have about 20 subforms all layered in the same position, and my code switches which form is visible. Not ideal apparently but its what I've got to work with.

This format makes adjusting the position of these subforms an absolute nightmare.

I was wondering

1) is there a way to group them all together so I just have to adjust one position and they all go with it

2) Can I set the position by code? I tried getting them all to call a function on load which sets the window position.

' from subform 'on load'
Call setFormPosition(Me)

Public Sub setFormPosition(TargetForm)
TargetForm.WindowHeight = 15.82
TargetForm.WindowWidth = 27.328
TargetForm.WindowTop = 4.312
TargetForm.WindowLeft = 4.788
End Sub

If I try this it says 'Object does not support this property or method'
Any ideas

Thanks in advance!

303
 
The easiest way is to create an option group but leave the contents blank by clicking on cancel when the wizard opens. Next cut and paste all your subforms into the option group placing them on top of each other. Now if you want to move the whole set of subforms you simply move the option group control.

Another solution would be to introduce a tab control and place each sub form on a seperate tab. Then use the visible property of each page to show/hide the relevant subforms. The reason why I suggest this is that whilst developing the main form you can easily navigate to the desired subform.
 

Users who are viewing this thread

Back
Top Bottom