Code:
Dim card() As String
This line says "I want a variable named 'card' that can hold an array of Strings, but I don't want the array yet; I'll create it later." For an array to be initialized, you have to provide a size. Since you haven't, there's no sensible array to create so
card holds Nothing.
You can initialize an array by giving it a size at creation:
Code:
Dim card(5) As String ' 6 elements
You can also set value with an initializer; VB will auto-calculate the size:
Code:
Dim card() As String = { "", "", "", "", "" }
After declaration, you have to use the ReDim statement to initialize the array:
Code:
ReDim(card, 5) ' 6 elements
That says "Create a 6-element array and assign it to the variable
card."
If you don't do any of these steps, the variable is Nothing because it has not been assigned a value.
If that message box is working as you describe, there is code you aren't showing, and I can't tell you about what I can't see.