I am trying to use a 2D array to gather information from a dialogue box. The array has been publicly dimensioned in a module. Before the dialogue box is opened, there is data in the array, and thats fine, but as soon as soon as the dialogue box is loaded, the contents of the array become "Nothing". The dialogue box is a seperate form that is loaded using the form2.showdialogue command.

If anybody knows why this is happening or how to fix it, any help would be greatly appreciated.

Thanks in advance.

8 Years
Discussion Span
Last Post by kdw3

Thanks for the reply but I actually managed to sort it out a few minutes before you replied. I managed to do it by declaring an object, putting the data from the array into the object and then using the following code

Dim objArray As Object
objArray = array

Dim CreateHeader As New frmCreateHeader(objArray)
'Where frmCreateheader is the form being used as the dialogue box


and then on the other form, I had the following code

Public Sub New(ByVal arraydata As Object)

'Dim arraytmp(,) As String
arraytmp = arraydata 'Where arraytmp is glob var defined in a mod.

' This call is required by the Windows Form Designer.

' Add any initialization after the InitializeComponent() call.

End Sub

There might be a better way to do it, and if you know please let me know, but that seems to be the most efficient method i have come across


This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.