Difference between revisions of "Documentation/FAQ/Databases/MS Access/How do I add Calculated Controls to my forms and reports?"
From Apache OpenOffice Wiki
< Documentation | FAQ | Databases | MS Access
(Created page with "{{DISPLAYTITLE: How do I add Calculated Controls to my forms and reports?}} <section begin=question/> '''How do I add Calculated Controls to my forms and reports?''' <section...") |
|||
Line 8: | Line 8: | ||
Controls in Base forms and reports cannot be used to perform calculations. There are two methods available to get a calculated result on a form or report. | Controls in Base forms and reports cannot be used to perform calculations. There are two methods available to get a calculated result on a form or report. | ||
− | + | ; Using a query | |
− | Modify the underlying data source of the form or report to perform the calculation for each record and return the result as a (calculated) field. | + | : Modify the underlying data source of the form or report to perform the calculation for each record and return the result as a (calculated) field. |
− | + | ; Using a macro | |
− | If you need your control to update as data is entered into a form, you will need to write a small macro to perform the calculation and assign it to an appropriate event on one of the data entry controls (e.g. the Text modified event). | + | : If you need your control to update as data is entered into a form, you will need to write a small macro to perform the calculation and assign it to an appropriate event on one of the data entry controls (e.g. the Text modified event). |
<section end=answer/> | <section end=answer/> | ||
Latest revision as of 12:41, 12 August 2022
How do I add Calculated Controls to my forms and reports?
Controls in Base forms and reports cannot be used to perform calculations. There are two methods available to get a calculated result on a form or report.
- Using a query
- Modify the underlying data source of the form or report to perform the calculation for each record and return the result as a (calculated) field.
- Using a macro
- If you need your control to update as data is entered into a form, you will need to write a small macro to perform the calculation and assign it to an appropriate event on one of the data entry controls (e.g. the Text modified event).