Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide the Detail section of Form

Status
Not open for further replies.

vttech

Technical User
Jan 28, 2006
297
US
I currently use
Code:
Me!frmPatientLookupResults.Form.Visible = False

to hide a subform on my form that is in the detail section of my form.


Is there a way to collapse or Hide the Detail section of the main Form??

I notice that their is a property under the Detail section called Visible
with an option for Yes or No.. How would I manipulate that option through
VBA? I am assuming that is the option that I am looking for


Newbie in search of knowledge
 
I tried

Code:
Me.Detail.Visible = False

But no luck. I am looking to collapse that section

Newbie in search of knowledge
 
Hiding the detail doesn't resize the form.
Try this:
Code:
Sub ToggleDetail()
   Me.Detail.Visible = Not Me.Detail.Visible
'resize the form to Detail + Header + Footer, added 500 more twips for the bar
   Me.Move Me.WindowLeft, , , IIf(Me.Detail.Visible, Me.Detail.Height, 0) + Me.Section(1).Height + Me.Section(2).Height + 500
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top