Hiding/Showing controlson a continuous form

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

    Hiding/Showing controlson a continuous form

    I have a form that is set to "continuous forms" view.
    Several rows of data are shown to the user at the same time.

    I want to set FieldX and FieldY to true and show them only if the
    txtEmailAddress control is not null and contains an address.

    Some rows shown in the detail section of the form will have email
    addresses, some will not. If a row doesn't have an email address,
    FieldX & Y's visible property must be set to false.

    I tried this on the "Click" event of the Detail Row, but it sets FieldX
    & Y to true for all rows, even those that contain an email address:

    If not isnull(txtEmail Address) then
    'email address present; show the fields
    FieldX.visible = True
    FieldY.visible = True
    else
    'email address absent; hide the fields
    FieldX.visible = False
    FieldY.visible = False
    EndIf

    I'm not sure, but is there a way to do this at the column level back in
    the table?

    Thnx....

    *** Sent via Developersdex http://www.developersdex.com ***
  • Albert D. Kallal

    #2
    Re: Hiding/Showing controlson a continuous form

    I certainly have a lot of continues forms where I set the controls 'enabled'
    property on/off. While this actually makes all instances of the control go
    disabled, I actually find this works quite well. I mean, when you move
    to the next row, those columns that you enable, or disable can then
    be set. So, you could set the controls visible property as you move
    the cursor up/down through the

    In fact, I actually PREFER the above behavior, as then during
    data entry it is VERY easy to see that the column in question
    is enabled.

    In place of a VERY HARD TO READ checkerboard pattern of enabled, and
    disabled boxes,
    , you get a very nice enable/display view as I move the cursor up /down.

    I have uploaded a gif animation of me navigating in a form, both of the two
    screen shots will give you an idea of how this looks.



    However, you could use conditional formatting, and that would allow you to
    set the background to some color (such as very gray) for those controls that
    you don't allow editing for (and, then you set/change the enabled property
    of that control).


    --
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada
    pleaseNOOSpamKa llal@msn.com


    Comment

    Working...