Dynamic height of Sub-form

A

Ameque

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.
 
S

Steve

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
 
A

Ameque via AccessMonster.com

Thanks Steve. That was reallly helpful and you have made me want to stay in
Access Monster.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top