Solved

Control Array and For...Next Loop

Posted on 1998-08-05
3
143 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

691 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