|
-
Jun 9th, 2006, 08:59 PM
#1
Thread Starter
Lively Member
Out of stack space
My program goes like this:
1) I have date range 6th to 16th
2) If current date equals to date range stated above, the Command1 button will be automatically clicked.
But, the problem is I got this error when running this program.
Runtime error '28':
out of stack space
Why this error occur ? Can someone help me correct this error?
Below is the code:
VB Code:
Private Sub lbltime_Change()
dateCreate_1 = Month(Now) & "/6/" & Year(Now)
dateCreate_2 = Month(Now) & "/16/" & Year(Now)
lbltime.Caption = Date
Dim bil As Date
For bil = dateCreate_1 To dateCreate_2
tarikhCreate = bil
Label1.Caption = tarikhCreate
If lbltime.Caption = Label1.Caption Then
Command1_Click
End If
Next
End Sub
-
Jun 9th, 2006, 09:22 PM
#2
Re: Out of stack space
doing lbltime.Caption = whatever calls the Change event.
if you do this within the change event then you're going to get recursive calling of your code - which can end up in Out of Stack Space errors when the calls get too 'deep'
-
Jun 9th, 2006, 09:36 PM
#3
Thread Starter
Lively Member
Re: Out of stack space
Actually, I didnt really understand ur post.
Can you suggest solution for this problem?
-
Jun 9th, 2006, 09:42 PM
#4
Re: Out of stack space
put a break point and then step through your code using F8
you'll probably find that it starts calling itself recursively - getting stuck and causing the error.
they can be hard to pin down without running code - it might be Command1_Click or lbltime.Caption = Date or combination of both, or something else.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|