Results 1 to 1 of 1

Thread: Syntax of adding combobox to get field

  1. #1
    KnobblesSteed is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Oct 2010
    Posts
    4
    Reputation
    0

    Exclamation Syntax of adding combobox to get field

    Hi,

    On the form, the user have to pick 4 different fields from combobox and then it will show into DataGridView

    here the code..
    -----------------------------------------------------------------------
    Dim EmployeeInt As New AcoSDK.Employee017

    DataGridView1.Columns.Add("id", "ID")
    DataGridView1.Columns.Add("FName", "FName")
    DataGridView1.Columns.Add("Name", "Name")
    DataGridView1.Columns.Add(ComboBox1.Text, ComboBox1.Text)
    DataGridView1.Columns.Add(ComboBox2.Text, ComboBox2.Text)
    DataGridView1.Columns.Add(ComboBox3.Text, ComboBox3.Text)
    DataGridView1.Columns.Add(ComboBox4.Text, ComboBox4.Text)

    Dim n As Integer = DataGridView1.Rows.Add()

    Do While (Error1 = 0)

    DataGridView1.Rows.Item(n).Cells(0).Value = EmployeeInt.EmNumber
    DataGridView1.Rows.Item(n).Cells(1).Value = EmployeeInt.EmFirstName
    DataGridView1.Rows.Item(n).Cells(2).Value = EmployeeInt.EmName
    DataGridView1.Rows.Item(n).Cells(3).Value = EmployeeInt. & ComboBox1.Text
    DataGridView1.Rows.Item(n).Cells(4).Value = 'EmployeeInt.' + ComboBox2.Text
    DataGridView1.Rows.Item(n).Cells(5).Value = "EmployeeInt." & ComboBox3.Text
    DataGridView1.Rows.Item(n).Cells(6).Value = EmployeeInt.ComboBox4.Text
    Error1 = EmployeeInt.NextKey(noIndex, True)
    Loop
    -----------------------------------------------------------------------

    So, i've tried everything and still getting errors in those 4 ways
    DataGridView1.Rows.Item(n).Cells(3).Value = EmployeeInt. & ComboBox1.Text
    DataGridView1.Rows.Item(n).Cells(4).Value = 'EmployeeInt.' + ComboBox2.Text
    DataGridView1.Rows.Item(n).Cells(5).Value = "EmployeeInt." & ComboBox3.Text
    DataGridView1.Rows.Item(n).Cells(6).Value = EmployeeInt.ComboBox4.Text

    please help me to have the correct syntax.

    KSteed
    Last edited by KnobblesSteed; 10-20-2010 at 10:16 AM.

Tags for this Thread

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
  •  
Harvest time tracking