3 Replies Latest reply on Nov 1, 2010 3:59 AM by WinstonChurchill

    Hiding/moving fields



      Hiding/moving fields


      Are there any scripting steps that will let me hide or move a field and maybe disable entry too, or do I need to create another layout to simulate such a feature.

      The script would be applied to field A, which has two possible values (1 & 2, say), if '1' is selected, I'd like field '1' to be seen on the layout, if '2' is selected then field '2' would be displayed in place of field '1'.

        • 1. Re: Hiding/moving fields

          This is a basic techinique, by John Mark Osborne, on the DatabasePros web site, Resources. You can go there and search for example files. Many of them are oldish, but well done. I'll put a direct link to where the file is here:

          DBPros000743 : Visibility

          It is basically a portal whose relationship is only valid according to the conditions you set. If it matches, whatever is in the portal shows; it could be field(s), buttons, graphics, whatever (except another portal, though there are exceptions). If it does not match, there's nothing there; buttons will not work (though it will still show the "hand" on hover, it's not that smart).

          What it cannot do is make two enterable fields share the same space on the layout (not in a way that is useful). So you'd need to offset them somehow.

          • 2. Re: Hiding/moving fields

            And if using vs. 11, you can use two one-row portals of a self-join table occurrence (make it invisible) and attach your criteria directly to the portal which would return Boolean true result.

            First portal would hold field1 and portal filter would be: Field A = 1

            Second portal would hold field2 and portal filter would be: Field A = 2

            And as Fenton explains, the fields (with their portals behind) cannot share exact same space. :^)

            • 3. Re: Hiding/moving fields

              Thanks to both of you, I' pretty much resolved the task with another approach when the answers came through, but I've made a note of both processes because they can be used a little further down the line in the database I'm working on.