PC Review


Reply
Thread Tools Rate Thread

Control Arrays

 
 
=?Utf-8?B?UHJhbWF0aGE=?=
Guest
Posts: n/a
 
      27th Nov 2005
control arrays can be used in VB which reduces amount of code that needs to
be entered. is it possible to use the same concept in MS Access which has VB,
because the controls don't have "Index" in their properties and Access does
not allow the user to use the same name for more than one control.
if control arrays can't be used is there anything else that can be used
instead?
thanks.
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      27th Nov 2005
It's possible to use a naming convention for your controls, and simulate
control arrays that way.

For example, if you've got a number of checkboxes, you could name them
chkBox1, chkBox2, chkBox3 and so on. You can then refer to each of them in a
loop like:

Dim ctlCurr As Control
Dim intLoop As Integer

For intLoop = 1 to 10
Set ctlCurr = Me.Controls("chkBox" & intLoop)
' Use ctlCurr to refer to the "current" control
Next intLoop

As to having event procedures and the like, you can write a generic routine
that uses Screen.ActiveControl to determine which control is active, and put
that generic routine as the Event Procedure for all of the controls in the
pseudo control array.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Pramatha" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> control arrays can be used in VB which reduces amount of code that needs
> to
> be entered. is it possible to use the same concept in MS Access which has
> VB,
> because the controls don't have "Index" in their properties and Access
> does
> not allow the user to use the same name for more than one control.
> if control arrays can't be used is there anything else that can be used
> instead?
> thanks.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arrays of Multidimensional Arrays? barmy_mad@yahoo.co.uk Microsoft C# .NET 9 22nd Mar 2006 12:15 AM
Arrays of Multidimensional Arrays? barmy_mad@yahoo.co.uk Microsoft C# .NET 0 21st Mar 2006 09:09 PM
Arrays of Multidimensional Arrays? barmy_mad@yahoo.co.uk Microsoft C# .NET 0 21st Mar 2006 09:09 PM
arrays in arrays jacob Microsoft Excel Programming 4 29th Aug 2004 08:40 PM
Rectangular arrays Vs. multidimensional arrays. Nikhil Patel Microsoft C# .NET 2 21st Jul 2003 02:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:41 AM.