Calculating totals problem on a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a simple database that provides quotations for work to be undertaken.
There is only one table containing all the fields. On the nain form I have
four fields: Price, Price2,Price3 and Price4 to allow for up to four
different pieces of work on one quote. I want to be able to total the costs
of each of the four elements and display as a total figure on the form.

I have used Total=Sum([Price]+[Price2]+[Price3]+[Price4]). This works,
however, it totals the cost of ALL the figures in all the records and I just
want the total for each individual record to display on the form of that
record.

many thanks for any suggestions.
 
Then just add an unbound text box in the DETAIL section of the form to the
right of your other fields. Put something like the following in the
field...

==[Price]+[Price2]+[Price3]+[Price4]


Rick B
 
Hi Gerry,

You asked for suggestions. Be careful what you wish for ... :-)

Start over and redesign your database application by the rules.

You have designed your database as though an Excel spreadsheet were the
template for a database. It isn't. In Excel it's common to just add
another column when you have repeating data of the same type: Price1,
Price2, Pricen. That's a clear indication that you need another table for
Price.

Your application has more than one entity. Here I'm guessing what you might
call them but try Prospect/Client (one table), Contact, Address, Project,
Quote/Order (one table). There will likely be more tables before you're
done. In relational database design, you strive to properly identify the
entity type in play and then create a table for each entity. Then you can
create relationships between your representations of those entities that
mimic the relationships of the real-world entities.

Access has a steep learning curve but, once well begun, you can do some
really useful work. For starters, read a beginner book or two on Access.
Lurk these newsgroups; microsoft.public.access.tablesdesign and
microsoft.public.access.gettingstarted are a couple of good ones to start.
Every copy of Access comes with Northwinds.mdb, a good example for beginning
to learn. Open it up, try it out, look under the hood.

HTH
 
Back
Top