Solved

Control Array and For...Next Loop

Posted on 1998-08-05
3
139 Views
Last Modified: 2010-05-03
I am taking a class that has requested us to create a checker board.  I am having problems with clearing the board
and starting again.  I have a group array of labels for the checker squares.  I need to clear the BackColor from Blue to
white (vbwhite?), as well as set the focus to the TextBox control for the start value.  Here is my sample.  I can clear
the text boxes, but can not clear the labels and reset the program.  I am only clearing one of the 15 checkboxes (and I made sure that the label array was set up correctly)

Private Sub Command1_Click()
'clear input amount and outputs
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label1(Intex).BackColor = vbWhite


0
Comment
Question by:luna
  • 2
3 Comments
 

Author Comment

by:luna
ID: 1468066
Edited text of question
0
 

Accepted Solution

by:
zabman earned 50 total points
ID: 1468067
Use a FOR...NEXT LOOP!

Try the following:

Private Sub Command1_Click()
'clear input amount and outputs
Text1.Text = "" 
Text2.Text = "" 
Text3.Text = "" 

For Count = Min to Max              'where Min is the smallest,
  Label1(Count).BackColor = vbWhite 'and Max is the largest
Next Count                          'number in the array!

Hope this will not be considered cheating!

                            -- Neil Z. :-)

Send me a copy when your done, i'd like to see it!
0
 

Author Comment

by:luna
ID: 1468068
I will try it and let you know!  I don't consider it cheeting.  I have @ 3 projects that I was having problems with and the teacher is NO help at all.  I have been racking my brain for days...  I appreciate all of your help!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

839 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