Solved

output to control array

Posted on 2002-04-30
3
139 Views
Last Modified: 2010-05-02
I am working on a project and have setup a two dimensional array "RandomNum(4,4) as integer"  I have also setup 4 control arrays "lblBCard1" to" lblBcard4". What I need to do is generate random numbers between 1 to 75 and fill the RandomNum array (I have that part) now I need to convert my two dimensional array into a one dimensional array so I can display the numbers on the labels. This is part of a Bingo game and the control arrays are the cards (up to 4 players).
0
Comment
Question by:imfoxman
3 Comments
 
LVL 13

Accepted Solution

by:
crazyman earned 50 total points
ID: 6982938
dim iTemp as integer

somthing like...
for itemp = lblcard1.lbound to lblcard1.ubound
    lblcard1(itemp).caption = RandomNum(0,itemp)
next itemp
for itemp = lblcard2.lbound to lblcard2.ubound
    lblcard2(itemp).caption = RandomNum(1,itemp)
next itemp
for itemp = lblcard3.lbound to lblcard3.ubound
    lblcard3(itemp).caption = RandomNum(2,itemp)
next itemp
for itemp = lblcard4.lbound to lblcard4.ubound
    lblcard1(itemp).caption = RandomNum(3,itemp)
next itemp
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6982991
Or:

For intElement = 0 To 3
  For intControl = 1 To 4
    Me.Controls("lblCard" & CStr(intControl)).Item(intElement) = RandomNum(intControl - 1,intElement)
  Next
Next
0
 

Author Comment

by:imfoxman
ID: 6983253
Thanks Crazyman!!!! I appreciate the help.......also thanks to Tmcottee for the alternative view.

Mike
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

773 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