473,396 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Modular Array issue

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
2 1066

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
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Zero | last post by:
Hi, I am calculating an integer to the pwer of a large integer, e.g. 2^5000. It turns out that the result I always get is zero. I am sure that the result is too large to store in such type...
29
by: shmartonak | last post by:
For maximum portability what should the type of an array index be? Can any integer type be used safely? Or should I only use an unsigned type? Or what? If I'm using pointers to access array...
4
by: Nick Goloborodko | last post by:
Hi, I'm in the process of conceptualizing a new ASP.NET application. I'm a relative newbie in ASP.NET / .NET in general, so any comments will be greatly appreciated. Basically i need to make...
26
by: I_AM_DON_AND_YOU? | last post by:
This is the scenario: I have a VB.Net project comprising of a few Forms. On Form1 I have more than 20 buttons. There is a very lenghty code written in click event of each and every button. Right...
20
by: Tuvas | last post by:
I have made and recently posted a libary I made to do Modular Arithmetic and Prime numbers on my website at http://www.geocities.com/brp13/Python/index.html . I am currently in a crypotology...
2
by: Tyno Gendo | last post by:
I'm writing a test "modular site". So far I have created an App class, a Module Manager class and a couple of test modules. The Manager looks in a directory called 'modules' and then for every...
2
by: Canice | last post by:
I'm working on a web application where 90% of it is common 'product' code an the other 10% is customer specific. I want some method of separating the customer specific presentation, business and...
16
by: Nkhosinathie | last post by:
hi, i'm writing a program that is using 4 arrays of pointers to char,called article,noun,verb and preposition.the program should create a sentence by selecting a word at random from each array in the...
1
by: bob | last post by:
I have made a file: box.h that have some structs, simple functions etc. I have then made another file: print.h that have a class 'print' with methods to print the content from 'box' (content of...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.