By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,417 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,417 IT Pros & Developers. It's quick & easy.

Modular Array issue

P: n/a
I have an array declared as Public in a standard module and wish to
pass data from a combobox located on a form. The Combobox takes it's
data source using the Add method as follows:-

Sp_Cmb_Ac_Volt.Items.Add(110)

Sp_Cmb_Ac_Volt.Items.Add(120)

Sp_Cmb_Ac_Volt.Items.Add(230)

Sp_Cmb_Ac_Volt.Items.Add(240)

'Power Factor

Sp_Cmb_Pf.Items.Add(0.6)

Sp_Cmb_Pf.Items.Add(0.65)

Sp_Cmb_Pf.Items.Add(0.7)

Sp_Cmb_Pf.Items.Add(0.75)

Every time I try to get data back to the array I get problems. Can
anyone help?

Here's the Array declaration

Public Sub main()

Dim record_inf(0, 6) As String

record_inf(0, 0)

record_inf(0, 1)

record_inf(0, 2)

record_inf(0, 3)

record_inf(0, 4)

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

zo****@yahoo.com wrote:
I have an array declared as Public in a standard module and wish to
pass data from a combobox located on a form. The Combobox takes it's

Every time I try to get data back to the array I get problems. Can
anyone help?
What problems? You will have to be more specific. Are you getting an
exception?
Dim record_inf(0, 6) As String
This line create a 1 x 7 multi-dimensional array of strings
record_inf(0, 0)
record_inf(0, 1)
record_inf(0, 2)
record_inf(0, 3)
record_inf(0, 4)


You seem to be missing some code. What are these lines supposed to do?

Nov 21 '05 #2

P: n/a
<zo****@yahoo.com> schrieb:
I have an array declared as Public in a standard module and wish to
pass data from a combobox located on a form. The Combobox takes it's
data source using the Add method as follows:-

Sp_Cmb_Ac_Volt.Items.Add(110)

Sp_Cmb_Ac_Volt.Items.Add(120)

Sp_Cmb_Ac_Volt.Items.Add(230)

Sp_Cmb_Ac_Volt.Items.Add(240)

'Power Factor

Sp_Cmb_Pf.Items.Add(0.6)

Sp_Cmb_Pf.Items.Add(0.65)

Sp_Cmb_Pf.Items.Add(0.7)

Sp_Cmb_Pf.Items.Add(0.75)

Every time I try to get data back to the array I get problems. Can
anyone help?

Here's the Array declaration

Public Sub main()

Dim record_inf(0, 6) As String


Well, you didn't actually declare your array as public. You declared it
inside a method.

\\\
Public Module Program
Public RecordInfo(0, 6) As String

Public Sub Main()
Application.Run(New MainForm())
End Sub
End Module
///

In your main form:

\\\
Program.RecordInfo(0, 0) = Me.ComboBox1.Items(0)
....
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.