How to assign this?

  • Thread starter Thread starter HM
  • Start date Start date
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
 
. . .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
. . .
 
.... 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.
 
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


.
 
Back
Top