the code like
when I use watch to view the value of num, it show the value is 0, why?Code:Private Sub Form_Load()
Dim num As Integer
num = 3
End Sub
Printable View
the code like
when I use watch to view the value of num, it show the value is 0, why?Code:Private Sub Form_Load()
Dim num As Integer
num = 3
End Sub
after num = 3 it will contain 3
Normally it is, but when I use quick watch to view, it show the value is 0. this is why I wondering
basicaly you've defined num and a local variable to be used only with in the sub Form_Load. Any reference to it from any other sub will return null..Code:Private Sub Form_Load()
Dim num As Integer
num = 3
End Sub
To use num is a number of subs rather use
hope this helps..Code:private num As Integer
Private Sub Form_Load()
num = 3
End Sub
Gremmy..
I find the fault now, it is my fault, i put the codes which relationed to num wrongly in one function. Thank you.