iam coding a program to store textbox data into an array, iam using bounds inorder not to erase the previous data. and it is saying it needs an end of statement. Please help. Thanks. This is the code:

ReDim Preserve strArrMonth (LBound (strArrMonth)) to UBound(strArrMonth)+1) strArrMonth (UBound(strArrMonth)) = textBox.Text

Recommended Answers

All 3 Replies

Your parenthesis do not match (missing one opening).

UBound is not having one opening parenthesis

In VB.Net, the lower bound of an array is always 0, so you could change that. You are missing an opening parenthesis in front of UBound, or get rid of the closing bracket after the +1. After the +1), there should be a new line; the assignement should be on its own line.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.