Solved

Array of user defined (Type)

Posted on 2000-04-19
4
167 Views
Last Modified: 2010-05-02
I want to creat a project  that analyze an income survey.  The statistics for each home include ID number, number of members in the house hold, and yearly income.  As the data is  entered, they should be assigned to text boxes to the element of a user defined type.

The Report for the project will be sent to the printer and icludes the following:

It has three columns and 14 rows.

earth2d
0
Comment
Question by:earth2d
  • 2
4 Comments
 
LVL 28

Accepted Solution

by:
AzraSound earned 100 total points
ID: 2731821
Public Type income
    ID(0 To 13) As Variant
    numbMembers(0 To 13) As Variant
    yrIncome(0 To 13) As Variant
End Type


Dim counter As Integer 'keep track of how many values have been entered
Dim newInc As income

Private Sub cmdEnter_Click()
    newInc.ID(counter) = txtID.Text
    newInc.numbMembers(counter) = txtMem.Text
    newInc.yrIncome(counter) = txtIncome.Text
    counter = counter + 1
End Sub

is that what you are asking?  I wasnt sure what your real question was.
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 2731858
Sounds like homework!!!
0
 

Author Comment

by:earth2d
ID: 2732999
Option Explict
I think I am looking for something like this.
Dim intRow            As Integer
Dim intCol              As Integer

Private Type Survey
intIDNumber          As Interger
curAnnualSalary    As Currency
intPersons             As Integer
End Type

Then something like 3 combo boxes for input such
as this

cboSurvey(0)
cboSurvey(1)
cboSurvey(2)   'For Arrays

input data using
lstSurvey.AddItem    txtSurvey.Text
Etc Etc
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2733006
earth2d writes:
"I think I am looking for something like this."

Until you know what you want we wont be able to help you.  Even with your description above I dont know what it is you want.  All of a sudden there are comboboxes and a listbox. Please be more specific.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now