Results 1 to 3 of 3

Thread: [RESOLVED] Invalid property value matching 2 combo boxes

  1. #1

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Resolved [RESOLVED] Invalid property value matching 2 combo boxes

    I am matching 2 combo box indexes
    Some of my users are getting a Invalid property value in this procedure, Why?

    Code:
    If frmMain.cboPitch.ListIndex <> -1 Or frmMain.cboPitch.Text <> "" Then
           Me.cboPitch.ListIndex = frmMain.cboPitch.ListIndex
         End If
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Invalid property value matching 2 combo boxes

    If frmMain.cboPitch has more entries than Me.cboPitch, that error is very possible.

    You may want to double check the ListCounts of both of those comboboxes. Otherwise, I don't think we have all the details, like where do the combo box entries come from, for both of the combo boxes.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: Invalid property value matching 2 combo boxes

    Quote Originally Posted by LaVolpe View Post
    If frmMain.cboPitch has more entries than Me.cboPitch, that error is very possible.

    You may want to double check the ListCounts of both of those comboboxes. Otherwise, I don't think we have all the details, like where do the combo box entries come from, for both of the combo boxes.
    Thanks
    You are right, the list counts are different. I had entered a routine a couple yrs ago for this:
    Code:
    Public Sub MatchCboIndexes() 
    10     On Error GoTo e
    20       Select Case Me.cboPitch.ListIndex
               Case 0
    30           frmNewPricePerSq.cboPitch.ListIndex = Me.cboPitch.ListIndex
    40         Case 1 To 8
    50           frmNewPricePerSq.cboPitch.ListIndex = Me.cboPitch.ListIndex + 2 'gPitchIndex + 2
    60         Case 9
    70           frmNewPricePerSq.cboPitch.ListIndex = Me.cboPitch.ListIndex + 3 'gPitchIndex + 3
    80         Case Is > 9
    90           frmNewPricePerSq.cboPitch.ListIndex = 13
                 
    100          End Select
    110    
    120   Exit Sub
    Must have the problem routine later, without noticing
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

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