Functions

  • Thread starter Thread starter craig
  • Start date Start date
C

craig

how can ii tell a field to sum other fields, average
other fiels an do simple spreadsheet typr formulas?
 
how can ii tell a field to sum other fields, average
other fiels an do simple spreadsheet typr formulas?

You can't, and you shouldn't.

Access IS NOT A SPREADSHEET. It's a relational database. *They are
different*. Applying spreadsheet logic to a database will just get you
into some extremely bad designs! "You can drive nails with a crescent
wrench, but that doesn't make it a hammer" - if you want to do
spreadsheet calculations, use Excel, it's very good at it.

You can do calculations in Access Queries, but not in Tables. Tables
should store only "real" data; calculations and formulas should be
done in Queries, on Forms or Reports (as the control source of
textboxes), or in VBA code; or you can calculate Totals using a Totals
query or a Crosstab query.


John W. Vinson[MVP]
 
Put code something like this in your form's Open event:
Me!NameOfTextbox = <<Your formula>>

Or you can base the form on a query and use calculated fields in the query.
Something like:
Extension:[Quantity]*[Price]

If you need help with your database, contact me at my email address below. I
am in business to provide customers help with Access, Excel and Word
applications.
 
craig said:
how can ii tell a field to sum other fields, average
other fiels an do simple spreadsheet typr formulas?

craig,

Example (Aircode):

CREATE TABLE YourTable
(YourTableID AUTOINCREMENT
,Column2 LONG
,Column3 LONG
,CONSTRAINT pk_YourTable
PRIMARY KEY (YourTableID)
)

SELECT SUM(Y1.Column2 + Y2.Column3) As SumColumn
,AVG(Y1.Column2 + Y2.Column3) AS AvgColumn
,(Y1.Column2 * Y1.Column3) AS ForumlaColumn
FROM YourTable AS Y1


Sincerely,

Chris O.
 
Back
Top