Results 1 to 5 of 5
  1. #1
    PLD60 is offline Novice
    Windows 10 Office 365
    Join Date
    Apr 2023
    Posts
    5

    Expand SubForm

    I have a subform on my Customers Form where I write extensive notes. There is not room to view the entire note on the main form. With a Command Button how do I either expand the subform or have the Subform on the right side of the main form that is normally off screen and then change the view to make this visible. I have been able to hide and unhide the SubForm where I made the Subform large and placed over the Main Form. This works fine except when I Change to Design View and try to make changes.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    What you're doing or suggesting can be iffy. Why not open the comments/notes in a separate popup and modal form?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    I have been able to hide and unhide the SubForm where I made the Subform large and placed over the Main Form. This works fine except when I Change to Design View and try to make changes.
    rather than using the visible property, use the width property. Set the subform width to 0 or a very low number and to the right of the visible part of the form. Button code instead on making visible changes the left and width properties.

    so instead of

    subform.visible=true

    you have (if the subform needs to be 10cm wide (5670 twips))

    subform.left=subform.left-5670
    subform.width=subform.width+5670

    to 'close' reverse the process - note the change of order as well otherwise you risk going 'off form' and creating an error

    subform.width=subform.width-5670
    subform.left=subform.left+5670

    Just for a bit of fun, if you want to play around with the form timer to adjust in increments you can make it appear as if the subform has slid out from the right over say 1/2 second. So you might set the timer interval to 100 and in the timer event adjust left and width by 1134. once you have reached the size you want (e.g. width>5670), set the timer interval to 0 to stop the process.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,858
    Could you not just zoom the notes control?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Join Date
    Apr 2017
    Posts
    1,673
    Put your customers form into unbound form on leftmost page of tab control. Create another form with source as query from your customer table (with fields CustomerID and CustomerNote - with only textbox control linked to CustomerNote visible and filling the whole form). Create a customer notes subform based on this form on another page of tab control, and link it to customers form on 1st page by CustomerID (i.e. it will be a subform of your customers form). Don't allow adding/deleting rows in CustomerNote form.

    In subform on 2nd page always displays the note for active customer in customers form.

    In case you have a customer notes table, where several separate notes can be entered for customers (tblCustomerNotes: CustomerID, CustomerNote), you can use this table as source for customer notes subform instead of query from customers table (you have to allow adding/deleting when this is the case - those are only changes needed do make this design to work). With this design, you can enter several notes for every customer.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. error while trying to expand table
    By HavLaz in forum Access
    Replies: 1
    Last Post: 04-28-2022, 02:48 PM
  2. Combo Box Auto Expand
    By jlgray0127 in forum Forms
    Replies: 2
    Last Post: 06-25-2015, 07:05 AM
  3. Combo Box Auto Expand
    By khughes46 in forum Forms
    Replies: 9
    Last Post: 10-17-2014, 01:50 PM
  4. Expand Form to fit screen?
    By offie in forum Forms
    Replies: 1
    Last Post: 08-05-2014, 03:23 PM
  5. My subform does not expand!
    By Pantinosm in forum Forms
    Replies: 9
    Last Post: 07-25-2012, 09:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums