?
Solved

output to control array

Posted on 2002-04-30
3
Medium Priority
?
151 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 150 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Suggested Courses
Course of the Month16 days, 9 hours left to enroll

862 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