Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Module to modify text box on a report

Status
Not open for further replies.

capdownlondon

Technical User
Mar 4, 2007
9
GB
I know the theory behind what i want to do, but need some help programming this into my report.

I have a field that displays a running sum (over group), but what i want is either this same field or a 2nd field to display that same information but i want it to run through a module that does something like this (using textbox1 as the one with the running sum):

x= textbox1 / 350

-now just get the numbers after the decimal point and muliply by 350

and put this in textbox 2




Basically the effect of this will display the value upto 350 in a loop. so when it hits 350 the next number is then 1.

So 351 in textbox 1 will return 1 or 702 will display 2
 
capdownlondon,

Have a look at the modulus operator.

Ken S.
 
How are ya capdownlondon . . .

Try this in the [blue]ControlSource[/blue] of the second textbox (modulus rounds to integers before dividing creating an accuracy error):
Code:
[blue]=(([[purple][b][i]Textbox1Name[/i][/b][/purple]]/350)-Int([[purple][b][i]Textbox1Name[/i][/b][/purple]]/350))*350[/blue]


Calvin.gif
See Ya! . . . . . .
 
=[TextBox1] Mod 350

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top