Results 1 to 4 of 4

Thread: combo box and concatenating an integer(easy)

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    Howdy,
    I have a dropdown combo box and two option buttons and one
    list box.

    I want the list box to show the dropdown combo box selection and concatenate the option button choice.

    I am having trouble with the correct syntax.

    if I do something like :
    ____________________

    Private Sub cmdCalculate_Click()

    If optFour.Value = True Then
    intNumOne = 4
    End If

    lstHistory.AddItem cboShows.Text & intNumOne
    End Sub
    _____________________
    the cboShows.text shows up in my list box but the
    number that should be a four is a zero.
    If I change the intNumOne to a 4 like this
    lstHistory.AddItem cboShows.Text & 4
    then the four shows up.

    so I know it is possible but like I said I have the wrong syntax
    thanks to anyone who helps

    pnj

  2. #2
    Guest
    I'm somewhat confused, but nevertheless, try this and see if it's want you want.

    Code:
    'Add whatever is in the ComboBox to the ListBox
    List1.AddItem Combo1.Text
    
    'If the text is "10" then Option1 is selected, otherwise, Option2 is selected
    If Combo1.Text = "10" Then Option1.Value = True Else Option2.Value = True

  3. #3
    Addicted Member
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    184
    Are you sure you are getting the 4 into intNumOne? and not changing it anywhere to 0?

    Can you not get whats in the CombBox as a string then add the Integer like this?

    'Build String.
    strMyString = cboShows.Text & CStr(intNumOne )

    'Add String to List.
    lstHistory.AddItem strMyString

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537

    i'm a moron..sorry :)

    Opps....
    I had my option buttons named incorrectly.
    sorry for the confusion.
    pnj

Posting Permissions

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



Click Here to Expand Forum to Full Width