How to resize subform after using source object to change source in vba

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wanie2023
    New Member
    • Sep 2023
    • 1

    How to resize subform after using source object to change source in vba

    Hi, I have a form with a subform which has vba to resize when open. I use a dropdown menu to change the source of the subform using source object in vba but when i do this the subform changes size and is too small. Has anyone got any advice on how to resize the subform after changing the source of the subform?
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32662

    #2
    Hi Wanie2023.

    Welcome to Bytes.com.

    Excuse me if you've tried this already. It seems very obvious but your post doesn't really tell us very much about what you are working with.

    You already have code that resizes the Subform object when the main Form is opened. I would suggest that this code is removed from there and placed immediately after the line of code where you set the .Form property of your Subform object.

    If there is a reason why this might not be appropriate, or doesn't work, then please respond with the appropriate information about your situation so that we're in a position to help you with it.

    Comment

    • isladogs
      Recognized Expert Moderator Contributor
      • Jul 2007
      • 483

      #3
      Cross posted at another forum (AWF) where I discovered the OP was using an old version of my automatic form resizing code
      I wrote this response at the other forum:

      You are using an old version of the code originally written by Jamie Czernik back in 2003 but significantly modified by me over the past 20 years.
      Please study my detailed 4-part tutorial starting with ResizeForm Me - A Tutorial in Automatic Form Resizing

      I recommend you also download the latest version of the example app with updated code

      Comment

      Working...