How to get label captions from an array...? 
Author Message
 How to get label captions from an array...?

First of all, please excuse the multiple post - I'm not
sure what group to put in and really need a reply...

I would like to assign label captions inside of a
procedure.  I can't seem to get the syntax figured out.  
Here is what I would like to do:

[Reports]![EM]![101].Caption = dblMatrixData(0, 0)
[Reports]![EM]![201].Caption = dblMatrixData(1, 0)
[Reports]![EM]![301].Caption = dblMatrixData(2, 0)
[Reports]![EM]![401].Caption = dblMatrixData(3, 0)

Instead of writting out the 101 and 102, I would like to
have it coded so I could do the whole thing inside a
couple of for loops.

Any help/suggestions would be greatly appreciated.



Sat, 09 Oct 2004 05:44:40 GMT  
 How to get label captions from an array...?
Answered in microsoft.public.access.macros.

If you feel you need to post to more than one group (HINT: it's seldom
necessary), please have the courtesy to cross-post (send the one message to
all groups at once), rather than multi-post (send individual messages to
each group). In this way, all responses to your post will be available
together, regardless of what group the responder was in, and the rest of us
won't have to read your post multiple times. (It also uses fewer server
resources)

See http://www.mvps.org/access/netiquette.htm for more information.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele


Quote:
> First of all, please excuse the multiple post - I'm not
> sure what group to put in and really need a reply...

> I would like to assign label captions inside of a
> procedure.  I can't seem to get the syntax figured out.
> Here is what I would like to do:

> [Reports]![EM]![101].Caption = dblMatrixData(0, 0)
> [Reports]![EM]![201].Caption = dblMatrixData(1, 0)
> [Reports]![EM]![301].Caption = dblMatrixData(2, 0)
> [Reports]![EM]![401].Caption = dblMatrixData(3, 0)

> Instead of writting out the 101 and 102, I would like to
> have it coded so I could do the whole thing inside a
> couple of for loops.

> Any help/suggestions would be greatly appreciated.



Sat, 09 Oct 2004 06:44:23 GMT  
 How to get label captions from an array...?

Damon Combs schrieb:

Quote:

> First of all, please excuse the multiple post - I'm not
> sure what group to put in and really need a reply...

> I would like to assign label captions inside of a
> procedure.  I can't seem to get the syntax figured out.
> Here is what I would like to do:

> [Reports]![EM]![101].Caption = dblMatrixData(0, 0)
> [Reports]![EM]![201].Caption = dblMatrixData(1, 0)
> [Reports]![EM]![301].Caption = dblMatrixData(2, 0)
> [Reports]![EM]![401].Caption = dblMatrixData(3, 0)

> Instead of writting out the 101 and 102, I would like to
> have it coded so I could do the whole thing inside a
> couple of for loops.

> Any help/suggestions would be greatly appreciated.

For i = 0 To 3
  [Reports]![EM].Controls((i+1) + "01").Caption = dblMatrixData(i, 0)
Next i

Ralf



Sun, 10 Oct 2004 04:10:40 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Trouble Getting Label Caption To Display

2. Label.Caption too big for Label.Width

3. Label Caption in VBA

4. Permanently change a text label's caption?

5. Auto label/Caption change

6. Changing the caption property on a label at run time

7. Label Caption Change

8. Linebreak in label control caption

9. Changing label captions: how to refresh

10. Labels Captions permanent modification

11. Captions of Labels

12. Change label caption in userform on change of dropdown listbox

 

 
Powered by phpBB® Forum Software