• Select Case

    Author
    Topic
    #461078

    In a report I have a grouping base on unit. The control txtUnit brings in the, you guessed it, the unit where a fall occurred. It is reported as it’s index number, i.e. 3 = ICU. I want the actual name of the unit reported in an unbound textbox called txtUnits. I created the Select Case code below. The problem is that the txtUnits reports out for all units as the first number reported. For example two units reported falls in the month of July, ICU (3) and 2-North/Telemetry(4). But in the txtUnits ICU was reported in txtUnits for both units. How do I get the group heading to report correctly?

    Private Sub Report_Activate()
    Dim strUnitOfFall As Variant
    strUnitOfFall = txtUnit
    txtUnits = strUnitOfFall
    Select Case strUnitOfFall
    Case “1”
    txtUnits = “3-North”
    Case “2”
    txtUnits = “Pediatrics”
    Case “3”
    txtUnits = “ICU”
    Case “4”
    txtUnits = “2-North/Telemetry”
    Case “5”
    txtUnits = “Women’s Floor”
    Case “6”
    txtUnits = “Nursery”
    Case “7”
    txtUnits = “Emergency Department”
    Case “8”
    txtUnits = “Transport”
    Case “9”
    txtUnits = “OR”
    Case “10”
    txtUnits = “Same-Day-Surgery”
    Case “11”
    txtUnits = “HealthStart”
    Case “12”
    txtUnits = “Nursing Administration”
    End Select

    End Sub

    Thank you for your time and help. Fay

    Viewing 0 reply threads
    Author
    Replies
    • #1168212

      In a report I have a grouping base on unit. The control txtUnit brings in the, you guessed it, the unit where a fall occurred. It is reported as it’s index number, i.e. 3 = ICU. I want the actual name of the unit reported in an unbound textbox called txtUnits. I created the Select Case code below. The problem is that the txtUnits reports out for all units as the first number reported. For example two units reported falls in the month of July, ICU (3) and 2-North/Telemetry(4). But in the txtUnits ICU was reported in txtUnits for both units. How do I get the group heading to report correctly?

      Private Sub Report_Activate()
      Dim strUnitOfFall As Variant
      strUnitOfFall = txtUnit
      txtUnits = strUnitOfFall
      Select Case strUnitOfFall
      Case “1”
      txtUnits = “3-North”
      Case “2”
      txtUnits = “Pediatrics”
      Case “3”
      txtUnits = “ICU”
      Case “4”
      txtUnits = “2-North/Telemetry”
      Case “5”
      txtUnits = “Women’s Floor”
      Case “6”
      txtUnits = “Nursery”
      Case “7”
      txtUnits = “Emergency Department”
      Case “8”
      txtUnits = “Transport”
      Case “9”
      txtUnits = “OR”
      Case “10”
      txtUnits = “Same-Day-Surgery”
      Case “11”
      txtUnits = “HealthStart”
      Case “12”
      txtUnits = “Nursing Administration”
      End Select

      End Sub

      Thank you for your time and help. Fay

      I would tend to have an extra table that holds strUnitOfFall (numeric) and the description.
      Then in the query join your table to this table and show the description in the query.
      Then it becomes a bound control on the report.

      Hope i have helped, i may not have understood what you want though.

      • #1168344

        Boy was that dumb. I thank you. I was over thinking the process. Your suggestion was right on. Fay

    Viewing 0 reply threads
    Reply To: Select Case

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

    Your information: