Compile error expected array (1 Viewer)

cc.caroline15

Registered User.
Local time
Today, 01:57
Joined
Oct 23, 2014
Messages
23
Hi everyone,
I was hoping someone could help me with when I click the add bottom I get Compile error expected array & it's suppouse to check for a value in both text boxes, if either one is missing a message box should let the user know that they need to provide a value for both and this part works, Also if the user tries to add more names then the one's indicated on the input box a message box should let the user know the list is full and if the arrays are not full, then with a If statement within a For … Next loop to find the first element not containing
data (“”) and assign the names to the respective array elements; and clear the text boxes on the form.
I'm sure there is a lot of things wrong with this portion of my code, i'm having a hard time with arrays but can't figure out what. Can you please help me?? Thank you
http://www.accessforums.net/attachment.php?attachmentid=19966&d=1425768689
 

Attachments

  • 240CCA06.zip
    130 KB · Views: 138

jdraw

Super Moderator
Staff member
Local time
Today, 04:57
Joined
Jan 23, 2006
Messages
15,379
You have to dim strName as an array

strName() As String
 

cc.caroline15

Registered User.
Local time
Today, 01:57
Joined
Oct 23, 2014
Messages
23
Hi Jdraw,
I fix that but I'm getting a new error Subscript out of range & it highlights this line
If strName(intItems - 1) <> "" Then

Could you help me please?
 

Attachments

  • 240CCA06.zip
    129.2 KB · Views: 105

jdraw

Super Moderator
Staff member
Local time
Today, 04:57
Joined
Jan 23, 2006
Messages
15,379
Try the Debugging Tips link in my signature ---use the stepping through code material to isolate your issues.

Good luck.
 

Users who are viewing this thread

Top Bottom