Subform Resize help

SantoR

Registered User.
Local time
Tomorrow, 00:50
Joined
Apr 20, 2015
Messages
38
i have a mainform which has a subform.
i am changing my subform dynamically using
Me.objSubform.SourceObject = subformname

i am using a resizing code suggested by ken getz in the form_open event of mainform

on changing screen resolution everything in mainform changes nicely, but subform doesnot changes.

how rectify this or anyone has better approach
 
yes it does, by the way the i tried something
my subform was not assigned any sourceobject initially so i think it was not resizing it, so i assigned a dummy form to the subform at start and now it is getting re sized to the resolution. but on chaning the subform sourceobject it is not resizing the content of it...strange
 
i have a click event in mainform from where i assign subform
Forms![MainForm]![SubFm].SourceObject = "formname"

and in formname form_open event i am again calling resizing code

i noticed !!!
when i pre-assign formname in design mode to the subform and open the main form then everything comes neat and clean..all things in subforms also

but when i am trying to dynamically assign the form to the subform then it is not taking ......
 
exactly...but where should i put the code
i tried open , load, current of formname
 
In my experience I have had problems with the built-in events like on load, in that some things you expect to happen, don't.

The solution is to build a Public function within the form you are opening, open the form and then call the public function.

ie what i am looking for..where to put the code....THEN
 
did that..no success....

conclusion
works fine : when we set the SourceObject in the subform in design mode

no success : when activated using button/click

but something strange is happening
like when form is maximized and i click button to do resize : nothing happens

but when my form window is small,then
- if i click to load a form to subform and
- click button to do resize and
- maximize window.

subform gets re-sized automatically.

can someone explain why ?
 
Last edited:
code works OK - if i pre assign a form to the subform sourceobject

but is not when changing form allocated to subform dynamically through vba.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom