Collapse Subdatasheet Using Code

Elana

Registered User.
Local time
Today, 14:48
Joined
Apr 19, 2000
Messages
232
I would like to programatically collapse a subdatasheet after my user has selected a particular action on a form.

Any ideas on how this can be done?
 
The following assumes you have a subform named "SubForm" and a button named "Collapse". Clicking the button will collapse the subform and then expand it again. Remember when dealing with height that MS measures it in "twips". 1400 twips = 1 inch. 300 twips will leave the topics of the subform showing but hide all data (assuming there is no scroll bar at the bottom). If you want to hide the subform completely, just set the height equal to 0.

If Not SubForm.Height = 300 Then
SubForm.Height = 300
Collapse.Caption = "Expand"
Else
SubForm.Height = 1440
Collapse.Caption = "Collapse"
End If
 

Users who are viewing this thread

Back
Top Bottom