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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is a Control Array Possible In Access

Status
Not open for further replies.

chilledproduce

Programmer
Jun 27, 2001
15
0
0
GB
Hi

I've been developing a app that requires text boxes to be placed of the form according to time and place of booking, I remember reading that it waas not possible to create a control array within Access.

Does any one have any experience with anything similar. If it isn't does anyone have a work around.

Cheers

Phill
 
That's quite correct...

But you could emulate it using the tag property in each control....

Craig
 
Phill,
Another way would be to name the controls in such a way as to ease the emulation, ie txtTime1, txtTime2, etc, and loop them ie
for each i = 0 to me.controls.count -1
if left$(me(i).name,7) = "txtTime" then
'blah, blah

....or, if you're placing the controls on the screen relative to each other but based on one of the controls values, then something like this:
...Say control '1' is the anchor, placed first...
me.txtTime1.Left = nnn '<--some value for left position
for i = 2 to iControlArrayMax 'the high # of your 'array'
me(&quot;txtTime&quot; & i).left = me(&quot;txtTime&quot; & i-1).left + me(&quot;txtTime&quot; & i-1).width
....etc etc

--Jim
 
Hi Jim

Cheers for getting back.

The DB is currently using the almost exactly the code you suggested but my main problem is one of resource conservation. The Form has three sub-forms all displaying standard time slots and used for static bookings for the selected date on the main form.

I have at the moment 10 Rich TExt Boxes that can be set to visible and sized & positioned according to any dynamic booking that is created. I have used active X controls as they are not hidden by the sub - forms. What i really would like to find out is if it is possible to dynamically dimension an array of the RTB's rather than having to place them on the form at design time as i feel that the form is already resource hungry.

My solutions working at the moment I'm just wondering if there is a more efficent way of achieving the same thing.

Cheers Phill

 
Phil,

You cannot create controls in Access at run-time.....

Sorry!!

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top