Results 1 to 3 of 3

Thread: Select Case

  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='Fay Yocum' post='783695' date='09-Jul-2009 12:58']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[/quote]
    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.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Boy was that dumb. I thank you. I was over thinking the process. Your suggestion was right on. Fay

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •