I'm having problems with a public variable that won't hold its value between functions. I've done this before and can't figure out why it doesn't work.
categoryoperation is declared asCode:Private Sub btnCategoryAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCategoryAdd.Click tbCatText.Visible = True btnCategoriesSubmit.Visible = True btnCategoriesSubmit.Enabled = True categoryoperation = "Add" End Sub
its placed underneath the the are where the name of the form elements are declared.Code:Public categoryoperation as string
the function that uses this variable is
after categoryoperation's value is set to "Add" in the first function, it goes to nothing in the second, any help would be appreciatedCode:Private Sub btnCategoriesSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCategoriesSubmit.Click If categoryoperation = "Add" Then AddCategory() End If CleanUPCat() End Sub
Thanks
Mike




Reply With Quote