calculations

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access Training and help » Calculations

Calculations

resolvedResolved · Low Priority · Version 2003

Gill has attended:
Access Intermediate course
PowerPoint Intermediate Advanced course

Calculations

I need some help with the formulas involved in the build

RE: Calculations

Hello Gill, as you may not have seen the replies to Sinal on a similar question I have cheekily copied in those replies--but it does get you something quicker means we are all the more ready to answer your next questions!

Quoting Pete (trainer)
Formulas in Access are usually built either in queries or on Forms and Reports, if you are comfortable with the syntax of a formula you can type it directly into the field (Ab) from the Toolbox, or you can use the Expression Builder.

Using the Expression Builder gives you access to many different functions and formulas and enables you to 'build' your required calculation into the field. If you open the Expression Builder and check out the Functions option (double click on it) you will see a number of formulas for you to choose from.

You will know what type of calculation you are hoping to achieve, the Functions option will give you the formula to apply it.

Quoting my own reply to Sinal:
There are various ways to use formulas. One of the easiest examples to use is an on form formula. If you have a tabular form that shows more than one record on the form and you have a field that is numerical, for example Price then you can easily get a total of what is on the form by doing the following.

Go to design view and add a text box into a convenient space (you might be able to create space if need be by pulling out a bit of form space from the bottom edge of the footer bar). The text box you have created will currently be showing 'Unbound'. Over-write this with =Sum([Price]). Go to form view and you will see the total. You can use the label appropriately to show Total Value etc. If your field is not Price then put what ever its name is as it appears in design view on the form. The curve brackets is the way to use the Sum function--it tells Access to do a sum on what is in the brackets. The square brackets tells Access to look for a field name. You can alter the above equation or create a further text box as required, to do a different calculation. For example you may need to add VAT at 17.5% so you would insert =(Sum([Price]))*1.175

You can multiply two fields within a query to add a new column showing results against each record. If the field names are Quantity and Price then you would type into a new blank column in the query design grid (a query having Quantity and Price columns in it). You would type into the top row the following. Total: ([Quantity]*[Price]) In this example you don't need sum because it is just a multiplication within each record line. I have mentioned Sum as an operator but there are many others available, which you can see via Help when you have Access open.

I hope this was helpful.
Mark


 

Access tip:

Deleting duplicate records from a table

You cannot delete records tables where there duplicate records. A way around this is to create a new table which wont hold the duplicates. and then deleting the old table.

1. Use a make-table query based on this table only. IMPORTANT - Ensure that you include all of the fields from your original table or you may loose data.

2. Open the query's property sheet by using VIEW, QUERY, PROPERTIES, and set the Unique Values property to Yes

3. Because you have selected the Unique Values to Yes when you run the query, Access creates a new table without duplicate records. You can now delete the old table and rename the new one.

View all Access hints and tips


Server loaded in 0.09 secs.