Hi,

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.

Recommended Answers

All 2 Replies

Show us the code you are using to load the array.

Hi,
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

CreateHeader.ShowDialog()

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.
InitializeComponent()

' 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

Regards,
Kevin

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.