Place Fields In Particular Spot On Form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cindy

    Place Fields In Particular Spot On Form

    Hi. Based on the machines I select, certain fields of entry are made
    to be visible on a form. The problem is that I want them (the fields)
    one right under the other but do not want any blank or empty spaces if
    a field is not being used. It is easy enough to place one field on
    top of the other and make it visible if need be, but there are quite a
    few of them, and the same ten fields (for example) would have to be
    put one right over the other _at each placeholder_ in the form. That
    is quite cumbersome and not very practical. In short, is there any
    way to simulate a "can grow"-type scenario with actual fields of
    entry?

    Thank you kindly,

    Cindy
  • Linq Adams via AccessMonster.com

    #2
    Re: Place Fields In Particular Spot On Form

    You understand, I hope, that there's not going to be an easy way to do this!

    How many different combinations do you anticipate?

    If I were trying to do this, I'd use a Tabbed Control, setting up a page for
    each machine, with the textboxes needed for that particular machine, arranged
    as you like.

    After each page was set up, I'd select the Tabbed Control (make sure it's the
    control itself, not one of the pages) and set its Style to "None." This will
    remove the tabs from the top.

    Either set the Visibility property for each page to No/False, or set all of
    them to False except the page, if any, that shows all the textboxes,
    whichever you prefer for cosmetic purposes.

    When the machine is selected, set the Visibility for the appropriate page to
    True.

    You'll need to place the same code that decides which tabbed page is visible
    in the Form's OnCurrent event as well.

    --
    There's ALWAYS more than one way to skin a cat!

    Answers/posts based on Access 2000/2003

    Message posted via http://www.accessmonster.com

    Comment

    • Carlos Nunes-Ueno

      #3
      Re: Place Fields In Particular Spot On Form

      Another option would be to use subforms. You can stack one subform on top
      of another and set the visibility as necessary. I just used this strategy
      with a DB that needed to compile information from a bunch of paper forms
      that had two different formats, with some fields shared but the majority
      specific to one format or the other. I put the shared fields in one table
      and subclassed the fields that applied to just one form or another out to
      their own tables. Then I was able to use separate subforms for the
      distinct layouts and field groupings.

      If you use this strategy you have to be careful about how the main form and
      subforms interact, because it can get unpredictable and you can create
      update problems for yourself if you don't have it quite right. But this
      way you can create your form layout once, do a save as to duplicate the
      form, and change the control sources on the new form to what they need to
      be. That gets you your consistent layout with the different data sources.

      Comment

      • bobh

        #4
        Re: Place Fields In Particular Spot On Form

        On Jun 1, 10:00 pm, Cindy <cindyc...@hotm ail.comwrote:
        Hi.  Based on the machines I select, certain fields of entry are made
        to be visible on a form.  The problem is that I want them (the fields)
        one right under the other but do not want any blank or empty spaces if
        a field is not being used.  It is easy enough to place one field on
        top of the other and make it visible if need be, but there are quite a
        few of them, and the same ten fields (for example) would have to be
        put one right over the other _at each placeholder_ in the form.  That
        is quite cumbersome and not very practical.  In short, is there any
        way to simulate a "can grow"-type scenario with actual fields of
        entry?
        >
        Thank you kindly,
        >
        Cindy
        Hi,
        You can use the Left and Top properties to specify an object's
        location on a
        form, but if you have a 'lot' of controls then this will be very vba
        code writing tedious.
        bobh.

        Comment

        • Tony Toews [MVP]

          #5
          Re: Place Fields In Particular Spot On Form

          Cindy <cindyc100@hotm ail.comwrote:
          >Hi. Based on the machines I select, certain fields of entry are made
          >to be visible on a form. The problem is that I want them (the fields)
          >one right under the other but do not want any blank or empty spaces if
          >a field is not being used. It is easy enough to place one field on
          >top of the other and make it visible if need be, but there are quite a
          >few of them, and the same ten fields (for example) would have to be
          >put one right over the other _at each placeholder_ in the form. That
          >is quite cumbersome and not very practical. In short, is there any
          >way to simulate a "can grow"-type scenario with actual fields of
          >entry?
          What type of machines and what type of fields? I ask because maybe the database
          isn't properly normalized and maybe some of those fields should be in their own
          tables. Maybe.

          What I prefer to do though would be to change the fields Enabled property to No.
          This greys out the field and the user can't enter anything.

          Tony
          --
          Tony Toews, Microsoft Access MVP
          Please respond only in the newsgroups so that others can
          read the entire thread of messages.
          Microsoft Access Links, Hints, Tips & Accounting Systems at

          Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

          Comment

          Working...