show / hide menu

Me.Height (Form with Dynamic Height)

The form variable ‘Me. Height’ is used in re-sizing the form. It helps in increasing or decreasing the height of the form. Consider a scenario where a form contains information that is currently not in use, it might depend on each user to use the portion of form or not. In such situations it is not practical to create different forms for each user, in such cases the form variable ‘Me.Height’ can be used to increase or decrease the form size according to the user’s need.
The following are the steps to describe how to use this form variable ‘Me.Height’.

Step 1. Create a form as shown in the figure. Add two buttons in the form named as ‘Increase form size’ and ‘Decrease form size’ for increasing and decreasing the form size accordingly.

Figure 1: Designer

The preview of the above form is as shown below. In the below screen, the form with only the basic information as per the form size gets displayed to the user. Upon clicking the button ‘Increase form size’, the form size gets increased to display the rest of the form. It would depend on individual users using it.

Figure 2: Preview

Step 2. Construct rule as per below syntax on the button trigger.
Syntax: Me. Height=Size

Example: As per the created form, for the button ‘Increase form size’, set a rule ‘Me. Height=800’ by using expression builder and for the button, ‘Decrease form size’, set a rule ‘Me. Height=300’. Once the button ‘Increase form size’ is clicked, the size of the form increases to a defined size set in the rule and when the ‘Decrease form size’ button is clicked the size if the for decreases.
The expression builder enables us to generate rules automatically. The rules panel on the left side is selected to generate the rules for the ‘Increase form size’ and ‘Decrease form size ‘buttons. The rules are generated as shown in the figures below

Figure 3: Rules panel
Figure 4: Expression Builder

And the rules are generated as shown in the figure below

Figure 3: Rule to increase the size of the form
Figure 4: Rule to decrease size of the form

Step 3. Add the form into the Web Part.

Figure 5: Web Part

Step 4. On clicking the button, ‘Decrease form size’, the size of the form will be decreased.

Figure 6: Decreased form size in web part

Step 5. On clicking the button, ‘Increase form size’, the size of the form will be increased. Here the user can view the additional information’s present in the form. And once the ‘Decrease form size’ is clicked then the form size decreases to the defined size by the user.

Figure 7: Increased form size in web part