MYOD - Make
Your Own Database - a tutorial by Cindy O'Hora |
Importing one database into another Other DB activities |
Radio Buttons and Calculations If you elect to use a radio button to collect data, you are confronted with a bit of a challenge. Suppose you want to calculate using the collected data? You must first convert the button's choice to a numeric value that can then be used in a calculation. When we first discussed radio button fields, I used the example of gender female-male. There are other uses. For this example, I'll use a wedding reception. The radio button of this wedding database offers a choice of entreé. You could use Find to determine the number of guests selecting each choice. You can also use summary fields to automatically add up all the choices. This is going to be a two step process. First, you must convert the button field's data to a number. In the second step, we'll use summary fields to add all the numbers. I'll show you how to do this for one choice. You'll need to repeat the process for the other choice in the button field. For the purposes of this lesson we have a database which has a button
field called entreé. How To:
Repeat this process to create another conversion calculation field for
ham
Look at your database. You'll see the two new fields are added. They should have either a 1 or 0 in each record depending on the choice made in the radio button. Adding it up 1.Go Layout ... Define Fields. 2. In the Field name box type Total hen. 3. Change the Field Type to Summary. 4. Click Create. This will open a Formula dialog box. 5. In the formula box enter SUM('conhen') 6. Click Okay. Click Done.
1. Go Layout ... Layout 2. Go Layout ... Insert Part. 3. Choose Trailing Grand Summary. 4. Click OK. You'll see that now there is an additional line added to
the bottom of the database and it is labeled Grand Summary. 5. Go Layout ... Insert Field. 6. Select Total hen in the list. 7. Click Insert. You should be looking at the database in Layout. The
field Total hen is now visible. 8. Drag it down into the area below the Body line, but above the Grand Summary line. SAVE! 9. Go Layout ... Browse. 10. Sort the database using the entreé radio
button as the sorting criteria. 11. Go Window ... Page view. 12. Scroll to the last record. Just below it, you will see the total
for hens. You must be in Page View to see the Grand Summary data. Feel free to switch back to non Page view. You only need to be there to check the results. * Suppose your SUM is currency. You'll notice that results are not given in currency format. Change the fomatting of the field to currency. Go: Layout .. Layout. Double click on the box for the total. In the format dialog box select currency..Save
Other examples of radio button calculations?
|
Database Activity - vocabulary |
Database - organizing | AppleWorks database tips |
Internet Hunts / Nature / Computers / Puzzles & Projects / Site map / Home