Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 132,494 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,064 people online right now. Registration is fast and FREE... Join Now!




Using Variable to get Variable value

 
Reply to this topicStart new topic

Using Variable to get Variable value

jamesagarry
post 4 Sep, 2008 - 12:47 PM
Post #1


New D.I.C Head

*
Joined: 4 Sep, 2008
Posts: 3


and example of the str_name filed is
dbl_aa201
the next time through it would be
dbl_aa202 etc
In an earler sub dbl_aa201 has a special calcualtion and the value
of dbl_aa201 would be "22.565"
if I go out to an imediat window and type
? str_name ' I get
dbl_aa201
then when I type
?dbl_aa201 ' I get
22.565
how can I get the answer of 22.565 from
? str_name





"
Set rs_ReportOut1 = New ADODB.Recordset
rs_ReportOut1.Open strsql, conn, adOpenKeyset, adLockPessimistic
x = 0
i = 0
' i am looing for the totals for dbl_aa189 plus about 80 more

i = 189
For x = 0 To 80
str_name = "dbl_aa" & i


arr_Field(x) = (str_name)

' arr_Value (x)


i = i + 1
Next x
User is offlineProfile CardPM

Go to the top of the page

thava
post 4 Sep, 2008 - 10:02 PM
Post #2


D.I.C Regular

Group Icon
Joined: 17 Apr, 2007
Posts: 424



Thanked 17 times

Dream Kudos: 50
My Contributions


need more information
User is offlineProfile CardPM

Go to the top of the page

dineeshd
post 5 Sep, 2008 - 01:28 AM
Post #3


D.I.C Addict

Group Icon
Joined: 30 Jun, 2008
Posts: 560



Thanked 16 times

Dream Kudos: 575
My Contributions


Things are not clear in your explanation. Anyway from what I can understand with your code is that, str_name = "dbl_aa" & i is making the trouble. Here you are assigning a string to str_name so definitely you will get a string out put only. You need to use arrays instead of string variables. Please explain clearly to get more specific help.

Please use Code Tags while posting code.
Example: code.gif
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 05:02PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month