probleum in handling the following error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • veer
    New Member
    • Jul 2007
    • 198

    probleum in handling the following error

    Hi
    i want to add a name into table but before that i want to check wheather the name is already in combo box or not that's why

    i am using the follwoing code but it show the error
    InvalidArgument =Value of '0' is not valid for 'index'. Parameter name: index

    my code is

    For i = 0 To frmMain.cboServ erName.Items.Co unt
    If LCase(Trim(txts ervername.Text) ) = LCase(frmMain.c boServerName.It ems(i)) Then
    MsgBox("Name Already Exist, Please Choose Other Name", MsgBoxStyle.Inf ormation, "Insert Error")
    txtservername.F ocus()
    Exit Sub
    End If
    Next


    the cboservername a combo box and it is empty


    please give some help


    best reGArds
    varinder
  • jamesd0142
    Contributor
    • Sep 2007
    • 471

    #2
    For i = 0 To frmMain.cboServ erName.Items.Co unt -1

    Comment

    Working...