If you're doing what I thing you're doing, try this syntax:
Me.Controls("tot" & pParam)

Signature
Wayne Morgan
MS Access MVP
> Hi everybody,
>
[quoted text clipped - 18 lines]
>
> Jose
YaKs - 14 Feb 2006 10:01 GMT
Hi Wayne,
I was mistaken, I am trying to that but not in Access, it is in Excel.
The sintax you said doesn't work either.
Should I try another one?
Thanks once again.
Wayne Morgan - 14 Feb 2006 11:08 GMT
Well, the syntax I gave didn't work because you're really using Excel.
Please try the Excel newsgroup, they'll be able to help you better.

Signature
Wayne Morgan
MS Access MVP
> Hi Wayne,
>
[quoted text clipped - 5 lines]
>
> Thanks once again.
> I would like to access to one variable by an indirect mode. I
> would try to explain myself:
[quoted text clipped - 14 lines]
>
> Thanks very much in advance
Sounds like you've used naming conventions for controls using
numbers.
Your mistake is in using the wrong method for concatenating the
name. What you want is:
Me("tot" & pParam)
You'd use the & concatenation operator because you don't want to
propagate Nulls (the + concatenation operator propagates Nulls, so
that if pParam is Null (assuming it's a Variant and can be Null),
then you'd be passing Me(Null) which will generate an error.
Me("tot") will also generate an error if there's no control of that
name, but probably a less serious error).
I'm not at all sure what this has to do with arrays, though.
Also, It sounds like you're populating repeating data, which sounds
like a possible design error somewhere along the way. Now, I've done
exactly what you're describing in particular situations, but it's
something of a kludge, in my opinion, as it ties your code to
objects on a form having been named in a particular fashion.

Signature
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
YaKs - 14 Feb 2006 09:11 GMT
Hi David,
I was mistaken, I am trying to that but not in Access, it is in Excel.
The sintax you said doesn't work either.
Should I try another one?
Thanks once again.
YaKs - 14 Feb 2006 09:20 GMT
One thing I forgot, I tried to acces not to a control, it is just a
global variable.
I already changed the program but I would like to know if it is
possible to do that thing.
Thank you very much
Cheers!
David W. Fenton - 14 Feb 2006 21:00 GMT
> Hi David,
>
[quoted text clipped - 4 lines]
>
> Should I try another one?
Post your question in an Excel group.
In any event, I expect that if you're trying to concatenate a
variable name you need to use Eval().
But my guess is that you need to completely change your approach to
the problem. In Access, I would suggest a custom collection or an
array, but I don't know what Excel's variety of VBA supports.

Signature
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/