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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change form header height and subform height

Status
Not open for further replies.

oxicottin

Programmer
Jun 20, 2008
353
0
0
US
Hello, I wanted to have a "+" and "-" on my form (frmVWI) and when pressed it expands my subform (frmSubformVWI)and makes my forms header smaller because the subforms in its detail section. I have some code that makes the subform visable ect. but not what im looking for. Any easy ideas or code samples I can use to acomplish this? Thanks!

Code:
Private Sub cmdVWIShutter_Click()

If cmdVWIShutter.Caption = "-" Then
        Form.Section(acHeader).Height = ?
        frmVWISubform.Height = ?
        cmdVWIShutter.Caption = "+"
    Else
         Form.Section(acHeader).Height = ?
         frmVWISubform.Height = ?
         cmdVWIShutter.Caption = "-"
    End If
End Sub

Thanks,
SoggyCashew.....
 
I figured this out as I had the same question. Use:
Code:
    If ShowFooter Then 'Put your condition here
        Me.Detail.Height = 5940 'Replace with your default form detail height
        Me.FormFooter.Height = 5160 'Replace with your default form footer height
    Else
        Me.Detail.Height = 5940 'Replace with your new form detail height
        Me.FormFooter.Height = 10 'Replace with your new form footer height
    EndIf
    DoCmd.RunCommand acCmdSizeToFitForm 'VERY IMPORTANT
 
How are ya oxicottin . . .

I believe you have your reasons for doing all this sizing ... but be aware: These changes your making in code are [blue]pseudo permanent![/blue] That is ... as long as the form is open the new values over-write the old. Close & reopen the form and [blue]the defaults take over again![/blue] To become permanent, the sizing values need to be saved in [blue]design view![/blue]

For reference:
1 inch = 1440 twips so that

twips = 1440 * inches

With [blue]Grid X[/blue] and/or [blue]Grid Y[/blue] set to the max of 64, the smallest increment/decrement becomes 0.0147 inches or 21.168 twips.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top