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

How to make this form... not as long? Opens up much bigger than needed 1

Status
Not open for further replies.

MattGreer

Technical User
Feb 19, 2004
471
US
So here's a screenshot of the form:

db2_tgwi8j.png


All that space below the last record... any way to get rid of it?



Thanks!!


Matt
 
Am I correct in assuming you want the window/form height to adjust based on the number of records displayed in the form? If there are more records, make the form higher automatically?

You can try code like the following.

Code:
Private Sub Form_Open(Cancel As Integer)
    Dim lngMargins As Long
    lngMargins = 1440   '1 inch
    Me.InsideHeight = lngMargins + Me.RecordsetClone.RecordCount * 400
End Sub

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
That's right. I guess I'm confused why other forms don't behave this way tho? But then on other forms I have other elements, but, I don't know, it's just odd.

Thanks!!


Matt

edit: BTW, your website link is kinda, well, you probably already know. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top