Results 1 to 5 of 5
  1. #1
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151

    Use of hidden text boxes.

    Hi all.



    For those of you who observe, I hope that you have a great holiday season.

    Not really a problem, just a disconnected, early morning, random thought.

    Though I've employed them myself on occasion, I often wonder whether the use of hidden text boxes is actually good practice, especially in the case of moving data from one form to another, or to get around some other coding issue.

    To me it seems a convenient/lazy way of moving a project forward without addressing the real issue at hand.

    I'm curious to know what other people think about this for no real reason than curiosity.

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Hidden tb's are the norm, especially when they hold the record id, which if it's an autonumber, the user should not see. Moving data around between forms, not so much. Not saying that's always wrong, but IMO it's often a sign that things are not designed correctly. If it has to be done then I see nothing wrong with hiding controls if it keeps the user from asking questions about things they don't need to know about.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Edgar is offline Competent Performer
    Windows 8 Access 2016
    Join Date
    Dec 2022
    Posts
    274
    Hidden controls are an application of the "adapter" design pattern. You want to make a working link between two incompatible tools that you can't modify, so you put something in the middle that the two can understand and then the two can interact with the adaptation in the middle to appear like it works as one. What seems lazy to you, might be perfect for others. Not all people have the same time/money constraints. You can aim for perfection, but many people take the "good enough" approach. You should do what makes you happy, but I would say the bad practice is to try to perfect and over-engineer something that you can already deliver.

    Just my opinion, I have wasted too much time trying to be perfect when a simple tempvar would solve it.

    Want to store your stuff using
    >hidden controls?
    >hidden forms?
    >tempvars?
    >tables?
    >openArgs?
    fine, whatever you choose comes with pros and cons and different degrees of complexity.

    Personally, I always choose what makes me release sooner, I have been there, OP, I've tried to be perfect, it has never been pretty, I just stopped it (kinda).
    Please click on the ⭐ below if this post helped you.


  4. #4
    Join Date
    Apr 2017
    Posts
    1,680
    Using hidden textboxes (or any other hidden controls) is obligatory, when:
    1. the form is based on table with autonumeric ID (the value of it can be only confusing info for user, so the best practice is to hide it);
    2. the same as above is true for FK's in linked subforms;
    3. you need a continous subform in bound/unbound main form to have another subform of main form behave like a subform of 1st one (you store the ID of active row in 1st subform in hidden textbox on main form, and link the 2nd form with it);
    4. You want to force the user to enter data into new record in certain order (of course you can also disable restricted controls until conditions are met, but again - why let the user click on unresponsible control again and again?)
    etc.

    Generally, as best any info on form, not essential for user to enter, edit, and read data there, must be invisible for him/her!

    About moving data from one for to another - to you mean copying an pasting it! If yes, then I think this is really bad practice. Both cecause the copy-paste, as there is no way to control all was right, and because this assumes, you have several forms based on identical tables in your database.

  5. #5
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151
    Hi all

    Thanks for sharing your thoughts and insights. So I guess I'll continue to use them where needed and they are appropriate. I guess, like all tools, if it's the right one for the job, them use it.

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

Similar Threads

  1. Replies: 7
    Last Post: 03-21-2018, 01:26 PM
  2. Replies: 2
    Last Post: 03-09-2018, 01:24 PM
  3. Hidden control characters in text file
    By Glenn_Suggs in forum Programming
    Replies: 3
    Last Post: 03-23-2015, 08:30 AM
  4. Eliminate Space from Hidden Text Box using CanShrink
    By Casey Sanders in forum Reports
    Replies: 4
    Last Post: 01-29-2013, 06:03 PM
  5. Replies: 0
    Last Post: 01-18-2011, 07:09 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