By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,122 Members | 927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,122 IT Pros & Developers. It's quick & easy.

Creating a variable from an expression

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
"> "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 discussion thread is closed

Replies have been disabled for this discussion.