473,395 Members | 1,343 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,395 software developers and data experts.

Creating a variable from an expression

I have a loop in a MS Access application of which I would like to
number the variables within the database as follows:

tbl
rev1
rev2
rev3...

I would like to do the following:

for i=1 to 20
rs![rev&i] = expression

next

The rs![rev&i] will not work??????

Please help!
Nov 13 '05 #1
2 1366
You could try rs.Fields("rev" & i).

But if you have multiple fields in a table which are so similar you want to
give them numbered names and treat them similarly, I'd suggest that you
consider normalizing your table design.

HTH
- Turtle

"Mike Blair" <bl*****@prodigy.net> wrote in message
news:49**************************@posting.google.c om...
I have a loop in a MS Access application of which I would like to
number the variables within the database as follows:

tbl
rev1
rev2
rev3...

I would like to do the following:

for i=1 to 20
rs![rev&i] = expression

next

The rs![rev&i] will not work??????

Please help!

Nov 13 '05 #2
"> "Mike Blair" <bl*****@prodigy.net> wrote in message
news:49**************************@posting.google.c om...
I have a loop in a MS Access application of which I would like to
number the variables within the database as follows:

tbl
rev1
rev2
rev3...

I would like to do the following:

for i=1 to 20
rs![rev&i] = expression

next

The rs![rev&i] will not work??????

Please help!

Mike,
The correct syntax is: rs(rev & i) = expression
Hank Reed
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Biff Malone | last post by:
I'm creating an element at run time with the following code <xsl:variable name="myElement"> <xsl:element name="abc"> <xsl:value-of select="." /> </xsl:element> </xsl:variable> ...
12
by: Ivan Marsh | last post by:
Hey Folks, Anyone know how to test for the existance of a variable in javascript? I'm looking for the equivalent of IsSet() from PHP. I'm having trouble finding it. thx --
11
by: randi_clausen | last post by:
Using SQL against a DB2 table the 'with' key word is used to dynamically create a temporary table with an SQL statement that is retained for the duration of that SQL statement. What is the...
134
by: James A. Donald | last post by:
I am contemplating getting into Python, which is used by engineers I admire - google and Bram Cohen, but was horrified to read "no variable or argument declarations are necessary." Surely that...
6
by: Michael B Allen | last post by:
I want to initialize a static variable to a "random" value like: static void * get_key(struct dnsreq *req) { static uint16_t next_txnid = (uint32_t)req & 0xFFFF; But gcc gives me an error: ...
8
by: Nanda | last post by:
hi, I am trying to generate parameters for the updatecommand at runtime. this.oleDbDeleteCommand1.CommandText=cmdtext; this.oleDbDeleteCommand1.Connection =this.oleDbConnection1;...
25
by: Sourav | last post by:
Suppose I have a code like this, #include <stdio.h> int *p; void foo(int); int main(void){ foo(3); printf("%p %d\n",p,*p);
2
by: Andy | last post by:
Hi guys I having a problem creating a report in Access 2003 project talking to a SQL database through and ODBC connect. After hours of trying things from Access Help, MSDN and Google I still...
7
by: Cromulent | last post by:
In section 6.7.5.2 it states the following: If the size is not present, the array type is an incomplete type. If the size is*instead of being an expression, the array type is a variable length...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.