Trying to create conditional visibility with Access 2010

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kais
    New Member
    • Nov 2012
    • 2

    Trying to create conditional visibility with Access 2010

    I am creating a database and have a combobox dropdown with two choices: "Open" or "Closed". When "closed" is chosen, I would like the "Reason for Closure" field to appear.

    This is what I have so far:

    Code:
    Private Sub Project_Status_AfterUpdate()
    
    If Me.Project_Status = "Closed" Then
    Me.Reason_for_Closure.Visible = True
    Else: Me.Reason_for_Closure.Visible = False
    
    End If
    
    End Sub
    This is making both the "true" and "false" statements blank.

    Advice? This is really annoying!
    Last edited by Rabbit; Nov 27 '12, 09:32 PM. Reason: Please use code tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    I have no idea what this means:
    This is making both the "true" and "false" statements blank.
    However, I suspect Project_Status is a drop down. And as such, the value that is bound can be different from the value that is displayed. Are you sure the bound value is Closed and it's not just a display value for an underlying key?

    Comment

    • kais
      New Member
      • Nov 2012
      • 2

      #3
      That solved it, thanks.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32653

        #4
        I'm guessing (due to the lack of clarity in the information posted) that you are dealing with a form that is in Continuous view. In such a case you need to understand that Controls are not restricted to the current record, but the same controls are used across all records. See Why Values in Unbound Form Controls do not Persist.

        There are ways around this. The simplest os probably to use Conditional Formatting. Otherwise you might need to work in the Print or Format events of the form.

        Comment

        Working...