If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Control Arrays
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. |
#2
|
|||
|
|||
Control Arrays
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" wrote in message ... 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. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Control does not refresh | Snowsride | Using Forms | 1 | October 4th, 2005 02:06 PM |
Data Entry Mode | bdehning | Using Forms | 17 | November 22nd, 2004 04:49 PM |
How can I move the focus to a control on a subform? | Brandon | General Discussion | 7 | July 17th, 2004 01:39 AM |
Access Calendar | lost | General Discussion | 2 | July 7th, 2004 04:58 AM |
AfterUpdate event of Calendar Control in Access 2000 not firing as expected? | Gary | Using Forms | 3 | July 2nd, 2004 07:53 PM |