Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Adjust the length of the Detail section if necessary so that there is approximately 0 . 5 inch below the frmBillingSubform control. The Detail section
Adjust the length of the Detail section if necessary so that there is approximately inch below the frmBillingSubform control. The Detail section should be approximately inches.
On the Form Design Tools Design tab, in the Controls group, click the Text Box tool
Position the pointers plus symbol below the frmBillingSubform at the inch mark on the vertical ruler and aligned with the inch mark on the horizontal ruler, and then click to insert the text box control and label in the form. Dont be concerned about positioning the control precisely because youll resize and move the label and text box later.
Open the Property Sheet, click the label control for the text box, set its Caption property to Number of Invoices, rightclick the border of the label control, point to Size on the shortcut menu, and then click To Fit. Dont worry if the label control now overlaps the text box control.
Youll use Expression Builder to set a Control Source property for the text box control.
Click the unbound text box control to select it click the Control Source box in the Property Sheet, and then click the propertys Build button to open Expression Builder.
In the Expression Elements box, click the expand indicator next to frmVisitsAndInvoices, and then click frmBillingSubform in the Expression Elements box.
Scroll down the Expression Categories box, and then doubleclick txtInvoiceNumCount in the Expression Categories box. See Figure
Figure
Text box controls expression in the Expression Builder dialog box
The Expression Builder dialog box is open. The Control Source property setting is in a text box at the top of the dialog box. In the Expression Elements list, f r m Billing Subform is selected. In the Expression Categories, the calculated control is selected from the list.Enlarge Image
Instead of adding txtInvoiceNumCount to the expression box at the top, the Expression Builder changed it to frmBillingSubform Form!txtInvoiceNumCount This expression displays the value of the txtInvoiceNumCount control that is located in the frmBillingSubform form, which is a form object.
You need to add an equal sign to the beginning of the expression.
Press HOME, type an equal sign and then click the OK button. The Expression Builder dialog box closes, and the Control Source property is set.
Next, youll add a second text box control to the main form, set the Caption property for the label control, and use Expression Builder to set the text boxs Control Source property.
Sidenote
Repeat Steps and to add a text box to the main form, positioning the text box at the inch mark on the horizontal ruler and approximately the inch mark on the vertical ruler, and setting the labels Caption property to Invoice Amount Total.
Click the unbound text box control to select it click the Control Source box in the Property Sheet, and then click the propertys Build button to open Expression Builder.
In the Expression Builder dialog box, type an equal sign in the Expression Elements box, click the expand indicator next to frmVisitsAndInvoices, click frmBillingSubform in the Expression Elements box, scroll down the Expression Categories box, and then doubleclick txtInvoiceAmtSum in the Expression Categories box.
Click the OK button to accept the expression and close the Expression Builder dialog box, close the Property Sheet, and save the form.
Click the Collapse the Ribbon button switch to Form view, and then display the record for VisitID See Figure
Figure
Form with calculated controls
The Access form f r m Visits And Invoices with a subform is open in Layout view. Directly below the subform, there are calculated controls labeled Number of Invoices, which shows the number of invoices in the subform, and Invoice Amount Total, which shows the total of the invoice amounts in the subform.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started