capdownlondon
03-24-2007, 08:47 AM
well basically i have a field that displays a running sum, and what i want it to display is the running sum upto 350 and then start from 0.
What i was thinking, is it possible to code the text box that displays the running sum to store the value of the running sum, but the code says
only show 0-350. so if the value was 351 the textbox would only show 1.
or for example if the value was 700 it would show 350. etc
stopher
03-25-2007, 01:19 AM
If I understand you correctly I think you want the MOD operator
10 MOD 5 returns 0 (the remainder of the division)
11 MOD 5 returns 1 etc
You need to do a slight shift though because obviously you don't want zero returned.
So (([myInput]-1) Mod 350)+1 should give you what you need I think i.e.
[myInput]_______(([myInput]-1) Mod 350)+1
1______________________1
2______________________2
349____________________349
350____________________350
351____________________1
700____________________350
701____________________1
etc
hth
Stopher
capdownlondon
03-25-2007, 02:40 AM
yes this looks like what i need- thankyou.
but where would i put this code on the form?
how would i implement it?
capdownlondon
03-25-2007, 02:55 AM
I hear i am to put it in the control source, but i am getting an error "#Name?"
capdownlondon
03-25-2007, 03:09 AM
Ooops!
Ok that bit was my bad. I had a bit f code i was trying to do earlier, to fix the problem, and i forgot about it. Just deleted it and it all works fine.
Thankyou for your help:D