Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Control Array Question

Posted on 1999-06-29
6
Medium Priority
?
153 Views
Last Modified: 2010-05-18
This one is stumping me.  I have a form with about 70 check boxes on it.  Next to these check boxes I have placed text boxes with a visible property of false.  I have made both of these control arrays.  One control array for the check boxes and another for the text boxes.  What I would like to do is write code to allow the user to make the text box next to the check box visible when the check box is clicked.  How can I do this utilizing the control arrays?  Any help would be appreciated.  Thanks a bunch.  
0
Comment
Question by:jakemail
[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
  • 4
  • 2
6 Comments
 
LVL 2

Accepted Solution

by:
SLE earned 300 total points
ID: 1520887
Private Sub Check1_Click(Index As Integer)
    Text1(Index).Visible = (Check1(Index) = 1)
End Sub
0
 
LVL 2

Expert Comment

by:BeedleGuis
ID: 1520888
if chkboxary(index).value = vbchecked then
    txtboxary(index).visible = true
else
    txtboxary(index).visible = false
endif

place this in the chkboxary_click event and in the in the chkboxary_keypress event use:

if keyascii = vbkeyspace then
    if chkboxary(index).value = vbchecked then
         txtboxary(index).visible = true
    else
         txtboxary(index).visible = false
    endif
end if
 

make sure your indexs' match for corresponding chkboxs' and txtboxs'
0
 
LVL 2

Expert Comment

by:BeedleGuis
ID: 1520889
either way ..  obviously sle's solution had the speed advantage.  :-)
0
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!

 
LVL 2

Expert Comment

by:SLE
ID: 1520890
BeedleGuis, there's no need of triggering the KeyPress event - pressing the spacebar already invokes the Click event...
0
 
LVL 2

Expert Comment

by:BeedleGuis
ID: 1520891
either way ..  obviously sle's solution had the speed advantage.  :-)
0
 
LVL 2

Expert Comment

by:BeedleGuis
ID: 1520892
ok .. good point, don't know how that last comment got in there twice.  all I did was hit refresh
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

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…
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 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…
Suggested Courses

671 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