If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Dynamic height of Sub-form
Want to create dynamic height of a subform am working on. The source object
of the form varies according to what is selected in a combo box and would want the form to adjust according to the source object. -- A Crab does not bite; only it's handshake is a bit rough |
#2
|
|||
|
|||
Dynamic height of Sub-form
A subform is a control that has a height property. The height property is
expressed in twips where 1 twip = 1/1440 inch. So if you have a subform named MySubform and you want it to be 2" high, use: Me!Mysubform.height = 2880 To set the subform height according to a selection in a combobox, use Select Case in the AfterUpdate event of the combobox. Put the following code in the AfterUpdate event of your combobox: Select Case Me!NameOfYourCombobox Case Value1 Me!Mysubform.height = 1440 Case Value2 Me!Mysubform.height = 2160 Case Value3 Me!Mysubform.height = 2880 End Select Where Value1, Value2 and Value3 are the values you see in the dropdown list. If Value1, Value2 and Value3 are numerical, use the code as is above. If Value1, Value2 and Value3 are text, enclose Value1, Value2 and Value3 in double quotes in the code above. Steve "Ameque" u45106@uwe wrote in message news:87dedcea3fae1@uwe... Want to create dynamic height of a subform am working on. The source object of the form varies according to what is selected in a combo box and would want the form to adjust according to the source object. -- A Crab does not bite; only it's handshake is a bit rough |
#3
|
|||
|
|||
Dynamic height of Sub-form
Thanks Steve. That was reallly helpful and you have made me want to stay in
Access Monster. Steve wrote: A subform is a control that has a height property. The height property is expressed in twips where 1 twip = 1/1440 inch. So if you have a subform named MySubform and you want it to be 2" high, use: Me!Mysubform.height = 2880 To set the subform height according to a selection in a combobox, use Select Case in the AfterUpdate event of the combobox. Put the following code in the AfterUpdate event of your combobox: Select Case Me!NameOfYourCombobox Case Value1 Me!Mysubform.height = 1440 Case Value2 Me!Mysubform.height = 2160 Case Value3 Me!Mysubform.height = 2880 End Select Where Value1, Value2 and Value3 are the values you see in the dropdown list. If Value1, Value2 and Value3 are numerical, use the code as is above. If Value1, Value2 and Value3 are text, enclose Value1, Value2 and Value3 in double quotes in the code above. Steve Want to create dynamic height of a subform am working on. The source object of the form varies according to what is selected in a combo box and would want the form to adjust according to the source object. -- A Crab does not bite; only it's handshake is a bit rough Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|