Results 1 to 3 of 3

Thread: More combo problems

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    More combo problems

    I have a combo on my form whos purpose is to allow users to search the form. The combo displays "itemDescription" but holds "itemID" as Valuemember.

    I have populated a combobox with the following:

    daCombo.FillSchema(dsCombo, SchemaType.Source, "tblItems")
    'fiLLDATASET WITH INFO FROM DATAADAPTOR
    daCombo.Fill(dsCombo, "tblItems")
    'empty combo box
    ComboBox2.Items.Clear()
    'fill combobox2
    ComboBox2.DataSource = dsCombo.Tables("tblitems")
    ComboBox2.DisplayMember = "itemDescription"
    ComboBox2.ValueMember = "itemID"

    I then use the following line of code:

    objROw = objdataset.Tables("tblItems").Rows.Find(ComboBox2.SelectedItem.ToString)

    Which throws up this error:

    "Additional information: Input string was not in a correct format."

    Parksie

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I think Find only uses the Primary Key index so if the ItemID is the primary key then you'd have to use:
    VB Code:
    1. objROw = objdataset.Tables("tblItems").Rows.Find(ComboBox2.SelectedValue)

  3. #3

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    Tried that.

    I get an error message.

    Incorrect type or something along those lines.


    I'm gonna kill myself.


    AAAARRGGGGGGGGHHHHHHH

    Parksie

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