Not sure exactly what I should be asking other than is there a way to get the code below (with modifications) to work. What I want to be able to do is to pass the name of the Form and the name of the ComboBox control to the Sub and have it add the "default" text at the top of the DD List based on which tool the user is currently using. Subsequently it will add the rest of the values from the database to the list.
Any help or suggestions are appreciated.
Thanks,
KK
Any help or suggestions are appreciated.
Thanks,
KK
Code:
Public Sub fillCatalogCombo(ByVal frmName As Form, ByVal cbobxName As String) Dim CatCboFill As New linqFillCatalogCboDataContext Dim topText As String = "" Dim frmText As String = frmName.Name.ToString Select Case frmText Case "frmSearchItems" topText = "All Catalogs" Case "frmItemMaintenance" topText = "Enter or Select" End Select frmName.cbobxName.Items.Add(topText) Dim Cats = From c In CatCboFill.sp_FillItemSearchCatalogCbo Select c For Each Cat In Cats frmName.cbobxName.Items.Add(Cat.Description.ToString) Next CatCboFill = Nothing End Sub
Comment