A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Dynamic height of Sub-form



 
 
Thread Tools Display Modes
  #1  
Old July 29th, 2008, 01:06 PM posted to microsoft.public.access.tablesdbdesign
Ameque
external usenet poster
 
Posts: 1
Default 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  
Old July 29th, 2008, 03:46 PM posted to microsoft.public.access.tablesdbdesign
Steve[_57_]
external usenet poster
 
Posts: 598
Default 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  
Old July 29th, 2008, 08:15 PM posted to microsoft.public.access.tablesdbdesign
Ameque via AccessMonster.com
external usenet poster
 
Posts: 1
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.