HALP! I need some help understanding why my code gives me an error. basically, i want a command button to (on each click) to advance the value of (and what is shown) on a particular text box.
"txtProInstall" is the name text box.
"cmdAdd" is my command button.
here is the code i tried:
Private Sub cmdAdd_Click()
Dim txtProInstall As TextBox
Set txtProInstall.Value = txtProInstall.Value + 1
End Sub
to start out, this is a very simple form (in an excel app) with just these two things on it (besides a label for the text box), but i intend to add more of these, and also a button to declinate the value by one as well for the appropriate text box.
when i try to run the form, i get this error:
"Run-time error-91:
Object variable or With block variable not set"
any ideas on how to fix this? do i have to initialize the form with pre-set values first??
many thanks
"txtProInstall" is the name text box.
"cmdAdd" is my command button.
here is the code i tried:
Private Sub cmdAdd_Click()
Dim txtProInstall As TextBox
Set txtProInstall.Value = txtProInstall.Value + 1
End Sub
to start out, this is a very simple form (in an excel app) with just these two things on it (besides a label for the text box), but i intend to add more of these, and also a button to declinate the value by one as well for the appropriate text box.
when i try to run the form, i get this error:
"Run-time error-91:
Object variable or With block variable not set"
any ideas on how to fix this? do i have to initialize the form with pre-set values first??
many thanks