Hi guys,
Can anyone of u tells me what is the problem with the following code:
I found error on line 1 "index outside of the valid range"
When i use without preserve then it works fine!!
Any kind of hint or help will be greatly appreacited
Yours,
Umer Siddiqi
Can anyone of u tells me what is the problem with the following code:
Code:
Dim feld() As String
Dim cnt as integer
Public Sub more_Click()
If Trim(txtFeld.Value) <> "" And Trim(obType.Value) <> "" Then
cnt = cnt + 1
If cnt > UBound(feld, 1) Then
ReDim Preserve feld(cnt, 2) ----------- line 1
End If
feld(1, cnt) = txtFeld.Value
feld(2, cnt) = obType.Value
Else
msgbox "Please enter feild name Or select data type"
End If
End Sub
When i use without preserve then it works fine!!
Any kind of hint or help will be greatly appreacited
Yours,
Umer Siddiqi
Last edited by a moderator: