ok.. here's my situation.. i've defined a dynamic array, it does not have a defined size, i've done this before with no errors. For some reason in this application its giving me a Subscript out of range error when I try to add to the ubound of the array.... I've tried everything I can possibly think of.. codes below please see if any of you more experienced coders see anything wrong...
Dim ticks() As String
Private Sub Command1_Click()
Dim i As String
Dim daytick As Long
Dim hourtick As Long
Dim mintick As Long
If itemnametxt.Text = "" Or notetxt.Text = "" Or daytxt.Text = "" And hourtxt.Text = "" And mintxt.Text = "" Then
MsgBox "You must complete the form!"
Exit Sub
End If
If daytxt.Text <> "" Then
daytick = daytxt.Text * 86400
End If
If hourtxt.Text <> "" Then
hourtick = hourtxt.Text * 3600
End If
If mintxt.Text <> "" Then
mintick = mintxt.Text * 60
End If
ReDim Preserve ticks(UBound(ticks) + 1)
ticks(UBound(ticks)) = daytick + hourtick + mintick
i = UBound(ticks)
List1.AddItem i + " " + itemnametxt.Text
Timer1.Enabled = True
Frame1.Visible = False
Call resetform
End Sub
Question
Powerworks
ok.. here's my situation.. i've defined a dynamic array, it does not have a defined size, i've done this before with no errors. For some reason in this application its giving me a Subscript out of range error when I try to add to the ubound of the array.... I've tried everything I can possibly think of.. codes below please see if any of you more experienced coders see anything wrong...
Thanks!
Link to comment
Share on other sites
3 answers to this question
Recommended Posts