Change Form Size in VB with an OnClick

Posted on 2005-04-07
Last Modified: 2008-03-03
I have a subform that has a good amount of information on it.  It resides on a main form that has a bunch of data too.  Is there a way to put a command button in so that if the user clicks it the subform will grow to a specified size or something similar?  

Thanks for the help, and let me know if you require more information.
Question by:busbeead
    LVL 39

    Accepted Solution

    during runtime size is manipulated in Twips. 1440 Twips = 1 inch

    Me.Width = 1440 * 7   '7 inches wide
    Me.Height = 1440 * 5   '5 inched wide

    LVL 8

    Assisted Solution

    set the subform object's .width and .height properties to whatever you want to change them to

    example (inverts width and height):

    Dim w as integer, h as integer

    w = sfrm.width
    h = sfrm.height
    sfrm.height = w
    sfrm.width = h

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    In the article entitled Working with Objects – Part 1 (, you learned the basics of working with objects, properties, methods, and events. In Work…
    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now