+ Reply to Thread
Results 1 to 3 of 3

changing label caption by user input

Hybrid View

  1. #1
    juliejg1
    Guest

    changing label caption by user input

    I have a combo box that I have written code to change a labels caption
    depending on what the user selects from the combo list. it works right until
    the last item in the list is chosen...it doesn't change. This is the code
    that I am using

    If cmbSavType.Value = "1) Last Year" Then
    lblBase.Caption = "Prior:"
    ElseIf cmbSavType.Value = "2) Other Levels" Then
    lblBase.Caption = "Market:"
    ElseIf cmbSavType.Value = "3) Inflation" Then
    lblBase.Caption = "Inflated:"
    ElseIf cmbSavType.Value = "4) Lowest" Then
    lblBase.Caption = "Lowest:"
    End If

  2. #2
    Tom Ogilvy
    Guest

    RE: changing label caption by user input

    the obvious answer would be that the last item isn't exactly

    "4) Lowest"

    so it doesn't pass the test and take the action to update the label.

    there may be an extra space in there somewhere.

    --
    Regards,
    Tom Ogilvy


    "juliejg1" wrote:

    > I have a combo box that I have written code to change a labels caption
    > depending on what the user selects from the combo list. it works right until
    > the last item in the list is chosen...it doesn't change. This is the code
    > that I am using
    >
    > If cmbSavType.Value = "1) Last Year" Then
    > lblBase.Caption = "Prior:"
    > ElseIf cmbSavType.Value = "2) Other Levels" Then
    > lblBase.Caption = "Market:"
    > ElseIf cmbSavType.Value = "3) Inflation" Then
    > lblBase.Caption = "Inflated:"
    > ElseIf cmbSavType.Value = "4) Lowest" Then
    > lblBase.Caption = "Lowest:"
    > End If


  3. #3
    juliejg1
    Guest

    RE: changing label caption by user input

    that fixed it. thnx1

    "Tom Ogilvy" wrote:

    > the obvious answer would be that the last item isn't exactly
    >
    > "4) Lowest"
    >
    > so it doesn't pass the test and take the action to update the label.
    >
    > there may be an extra space in there somewhere.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "juliejg1" wrote:
    >
    > > I have a combo box that I have written code to change a labels caption
    > > depending on what the user selects from the combo list. it works right until
    > > the last item in the list is chosen...it doesn't change. This is the code
    > > that I am using
    > >
    > > If cmbSavType.Value = "1) Last Year" Then
    > > lblBase.Caption = "Prior:"
    > > ElseIf cmbSavType.Value = "2) Other Levels" Then
    > > lblBase.Caption = "Market:"
    > > ElseIf cmbSavType.Value = "3) Inflation" Then
    > > lblBase.Caption = "Inflated:"
    > > ElseIf cmbSavType.Value = "4) Lowest" Then
    > > lblBase.Caption = "Lowest:"
    > > End If


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1