473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dynamic Variables

1
I need to create a set of variables that I can reference for some formulas (var1 + var2, etc) later on in the page. The data is being pulled from a db - the variable name and the value of the variable. I am having a hard time setting the value of the variable and then being able to reference it for display or the formulas.

do until subs.eof

thisvar = thisvar & "val_" & subs("acctname")


thisvar = subs("amount")


subs.movenext
loop

subs.close
set subs=nothing

Basically "thisvar" has become the value so instead of being able to do <%=(val_ADV)%>, I just nothing because that variable has gone away. I am sure I am overlooking something simple. Help would be SO appreciated!
Apr 1 '07 #1
1 1149
jhardman
3,406 Expert 2GB
I need to create a set of variables that I can reference for some formulas (var1 + var2, etc) later on in the page. The data is being pulled from a db - the variable name and the value of the variable. I am having a hard time setting the value of the variable and then being able to reference it for display or the formulas.

do until subs.eof

thisvar = thisvar & "val_" & subs("acctname")


thisvar = subs("amount")


subs.movenext
loop

subs.close
set subs=nothing

Basically "thisvar" has become the value so instead of being able to do <%=(val_ADV)%>, I just nothing because that variable has gone away. I am sure I am overlooking something simple. Help would be SO appreciated!
He, he, he. Silly mistake. Try:
Expand|Select|Wrap|Line Numbers
  1. do  until subs.eof
  2.  
  3.     thisvar = thisvar & "val_" & subs("acctname")
  4.  
  5.  
  6.     thisvar = thisvar & subs("amount")
  7.  
  8.  
  9.     subs.movenext
  10. loop
Let me know if it helps.

Jared
Apr 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Tommy Lang | last post by:
I am trying to learn to use dynamic variables. I have pasted the code below. Is this the proper way of using dynamic variables? Thanks, Tommy ...
4
by: Tim.D | last post by:
People, I've ventured into the wonderful world of Stored Procedures. My first experience has been relatively successful however I am stuck on using host variables to specifiy actualy table or...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
12
by: scott | last post by:
Is there a way to create dynamic variables when looping through a recordset? For example below, after the 1st loop I'd have myVarA1 and myVarB1, after 2nd loop, I'd get myVarA2 and myVarB2. CODE...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.