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!

use calculations on text data types

Status
Not open for further replies.

pandapark

Technical User
Jan 29, 2003
92
0
0
GB
hi

if i have 4 fields (quarter1-4) of data type text - how can I sum or average these 4 fields from a command button on a form?

e.g. quarter1 may be 50%
quarter2 50%
quarter3 75%
quarter4 100%

if I wanted the average I'd want the result 68.75

thanks
tim
 
Add a new unbound textbox and call it 'Average'.

Add your command button and in the OnClick Event enter

me!average = (val(me!quarter1)+val(me!quarter2)+val(me!quarter3)+val(me!quarter4))/4

Now when you click the button it'll display the average on your form.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top