• Hide control or show control depend on field value (Acc2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Hide control or show control depend on field value (Acc2000)

    Author
    Topic
    #393473

    I can’t find the search button for this forum, so here’s a question.
    I want to
    1) on a Report, make not-visible a control label if the control is null – but only on the particular record.

    2) On a Form, make visible an unbound label if a separate control has a certain value – again only for the particular record in the detail section of a form.

    Viewing 1 reply thread
    Author
    Replies
    • #713652

      Unfortunately, Search had to be disabled until we deal with some server issues.

      The answer to both your questions is VBA code. In a form, the situation is constrained by where the label is – header, footer or detail – and whether the form is continuous or single.

      In a report, you would need to use a detached label and the format event of the detail section. Alternatively, use a textbox and make it’s controlsource set it to null if the other control (or the field behind it) meets the condition. The specific way to do that depends on whether the other control is being tested for Null or for a specific value, but it would involve either an IIF statement or an Nz function.

    • #713653

      Unfortunately, Search had to be disabled until we deal with some server issues.

      The answer to both your questions is VBA code. In a form, the situation is constrained by where the label is – header, footer or detail – and whether the form is continuous or single.

      In a report, you would need to use a detached label and the format event of the detail section. Alternatively, use a textbox and make it’s controlsource set it to null if the other control (or the field behind it) meets the condition. The specific way to do that depends on whether the other control is being tested for Null or for a specific value, but it would involve either an IIF statement or an Nz function.

    Viewing 1 reply thread
    Reply To: Hide control or show control depend on field value (Acc2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: