Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control arrays in Access like in Visual Basic?

Status
Not open for further replies.

GWhiz

Programmer
Dec 16, 1999
49
US
Hi, folks!

Anyone know if it's possible to create control arrays in Access like one can do in Visual Basic? Like an array of text boxes with the same name, differentiated from each other by a subscript?

This seems to be one of the key differences between Access Basic and Visual Basic. There seems to be no real reason why this can't be done -- but there also seems to be no provision for it in Access.

Thanks for any input you can provide!

Respectfully,

GW
 
You can't create them in the same sense that you do in vb but if you can immitate it in a way. For example:

If you have three Text boxes you can name the "Text1", "Text2", and "Text3". Then when you want to reference all of them you can do it like this:

Dim x as integer

For x = 1 to 3
Debug.Print Me("Text" & x).Value
Next x

Hope this helps - Shane
 
Hi, Shane!

Ty for your quick response. Yes, your response helps. Was aware that this can be done.....and was using a similar version of your suggestion to simulate control arrays. I was just wondering if there was a fundamental difference between Access and VB -- or whether it might be possible to import or associate the control array capability in VB with Access through some means.

Knowing it can't be done......is very useful.

Thanks!

Respectfully,

GW
 
Access does not directly support custom Collection classes. There is another difference.

Gary
gwinn7
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top