Results 1 to 5 of 5
  1. #1
    ScubaBart is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Jul 2024
    Posts
    117

    Various ways to change UnBound text in multi-purpose form

    After some delays, hurricane related rain is letting me work inside today on the Apiary project.



    So, I have a form or two that are multi-purpose. They are used to accomplish different tasks depending on the chosen command. With that, several text elements within the form will change depending on what the specific task is. Some text is simple like the form Title. Others are more specific and may include compounding the table field value in the text. Easy enough.

    I have implemented two different approaches to this in other forms but am considering going back and adjusting to using the same method across the board.

    One is to make multiple controls and labels and control the visibility of them through the VBA code that opens the form.

    Two is to make just one control or label for each requirement and change the Value or Caption as required in the VBA code that opens the form.

    I strongly suspect there are additional options that I am not familiar with, and some may be more efficient if I knew what they are.


    So, the question is, what is the common method that is used for this condition ? If there is an alternate approach that's not super complicated, I can certainly entertain that but keep in mind, my coding is at a very beginning level.


    Curious to see what the preferred approach is.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I have used visibility to limit user input to a data control that should not get input until another control first has input.

    Otherwise, I have used approach to change Caption of buttons and labels or ControlSource of data controls.

    I can't think of other options.
    Last edited by June7; 09-27-2024 at 08:40 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    If you need code, it makes more sense to me to have one of each control and use something in the form source or property (e.g.OpenArgs) to set properties such as label captions if that's what you're asking about. It seems that code to control those properties is no harder than code to control visibility; the difference being less design work up front.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Rickwave is offline Novice
    Windows 10 Access 2021
    Join Date
    Sep 2024
    Posts
    3
    For changing unbound text in a multi-purpose form, the most common method is to use a single control and dynamically update its value or caption based on user input or selected commands. This approach simplifies your form design and reduces the need for multiple visibility settings, making it easier to maintain as you develop your coding skills.

  5. #5
    ScubaBart is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Jul 2024
    Posts
    117
    So primarily going with minimal controls and changing the value or caption as needed. There are a few cases where it makes more sense to control visibility when a given control simply isn't needed but otherwise, I have a general common approach now so am going with that.

    Thanks for the input.

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

Similar Threads

  1. Replies: 2
    Last Post: 08-17-2018, 11:45 AM
  2. Add item to an order form - rental purpose
    By Pickboy in forum Forms
    Replies: 2
    Last Post: 08-10-2018, 05:10 PM
  3. Replies: 3
    Last Post: 04-25-2017, 10:46 AM
  4. Replies: 11
    Last Post: 03-26-2013, 05:34 PM
  5. What's the purpose of multi key for one table?
    By latestgood in forum Access
    Replies: 3
    Last Post: 07-01-2011, 12:15 PM

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