How to assign this?

H

HM

Hi all,
I am using Access2K.
How to write a code to store 0 to x1,x2,x3,x4,x5,... in VB?
Best Regards,
HM
 
L

Larry Linson

. . .Access2K. How to write code
to store 0 to x1,x2,x3,x4,x5,... in VB?

Assuming the x1, x2, ... that you mention are variables, one statement for
each:

x1 = 0
x2 = 0
. . .
 
G

Graham Mandeno

.... like Larry says, or if they are fields in a recordset (say on a form):

Dim i as Integer
For i = 1 to 5
Me("x" & i) = 0
Next

If these are variables, perhaps you should consider using an array (it seems
from your "..." that the number is actually much greater than 5).

If they are fields, then it is strong evidence of a badly normalised
database. Take a look at:
http://support.microsoft.com/?kbid=283878

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.
 
H

HM

Soory for post reply late, because I still try to test it.
Yes, I want to assign var x1,...,x50 and then compute in
the form then pass var to print out report.
Thank you, I still working on it.
HM
-----Original Message-----
.... like Larry says, or if they are fields in a recordset (say on a form):

Dim i as Integer
For i = 1 to 5
Me("x" & i) = 0
Next

If these are variables, perhaps you should consider using an array (it seems
from your "..." that the number is actually much greater than 5).

If they are fields, then it is strong evidence of a badly normalised
database. Take a look at:
http://support.microsoft.com/?kbid=283878

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.

HM said:
Hi all,
I am using Access2K.
How to write a code to store 0 to x1,x2,x3,x4,x5,... in VB?
Best Regards,
HM


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top