Data Access Page - how to change visibility based on criteria?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JP Romano
    New Member
    • Oct 2008
    • 11

    Data Access Page - how to change visibility based on criteria?

    Hi - I'm putting together a status report summary for a team of about 15 based in the US (various places), London, Hong Kong, etc. The users have expressed interest in using a web form (data access page), which I have submitting data to an Access db on a shared network repository. They want the forms to be saved in a Sharepoint repository for easy access. So far, so good.

    Where I need a little help is in setting the data access page to hide or show some controls based on the type of update being submitted. For example, if they select the option "OUTAGE" from a combobox control, I want to show fields A, B and C, but hide X, Y and Z.

    I'm sure I could convince them to ditch Sharepoint and just put a shortcut to a form (instead of the data access page), but I'd like to give them what they asked for if it's possible.

    Thank you for any help!
    JP
  • DonRayner
    Recognized Expert Contributor
    • Sep 2008
    • 489

    #2
    Originally posted by JP Romano
    Hi - I'm putting together a status report summary for a team of about 15 based in the US (various places), London, Hong Kong, etc. The users have expressed interest in using a web form (data access page), which I have submitting data to an Access db on a shared network repository. They want the forms to be saved in a Sharepoint repository for easy access. So far, so good.

    Where I need a little help is in setting the data access page to hide or show some controls based on the type of update being submitted. For example, if they select the option "OUTAGE" from a combobox control, I want to show fields A, B and C, but hide X, Y and Z.

    I'm sure I could convince them to ditch Sharepoint and just put a shortcut to a form (instead of the data access page), but I'd like to give them what they asked for if it's possible.

    Thank you for any help!
    JP
    in the "After Update" event procedure for the combobox control use either IF or Select Case arguments to set each of the fields visible properties based on the value of the combobox. Eg:
    Code:
    If me.combobox = "update1" then
      me.control1.visible = true
      me.control2.visible = false
    Elseif me.combobox = "update2" then
      me.control1.visible = false
      me.control2.visible = true
    Elseif...... (up to however many selections you have)
    
    Else
      me.control1.visible = false
      me.control2.visible = false
    End If
    Or with a Case statement
    Code:
    Dim mycontrol as string
    mycontrol = me.combobox.value
    select case mycontrol
      case "update1"
        me.control1.visible = true
        me.control2.visible = false
      case "update2"
        me.control1.visible = false
        me.control2.visible = true
      case....(up to however many selections you have)
    
      case else
        me.control1.visible = false
        me.control2.visible = false
    End Select

    Comment

    • JP Romano
      New Member
      • Oct 2008
      • 11

      #3
      This is fantastic! Thanks a million

      Comment

      • DonRayner
        Recognized Expert Contributor
        • Sep 2008
        • 489

        #4
        Glad I could be of some help

        Comment

        Working...