Right-click in the Control Source field and choose Zoom... Append the domain name to complete an e-mail address as follow:
=[LastName] & Left([FirstName],1) & "@functionx.com".
4.
Close the Properties and switch to Form View.
5.
3 - Calculated Expressions:
You can defer the traditional calculations to Microsoft Access to reduce typing mistakes. Once you set your expressions clearly, the software will take care of the rest. You can type most expressions manually, otherwise, the Expression Builder that we have used earlier can assist you.
Open the Videos5 database.
1.
Double-click the frmVideos form to open it.
2.
Switch to Design View.
3.
From the Toolbox, click the Text Box and click on the right of Qty to add a text box to the form. Change the text of the label to Total. Format both the label and the text box to harmonize with the other items on the form.
4.
Right-click the text box and choose Properties. From the All tab, change its name to Total. In the Control Source field, click the build button. In the Expression builder dialog, click the = 5.
Switch to Form View. After playing with the form, close it and close the Videos5 database.
6.
4 - Subforms:
A subform is a child of a form that allows you to instantaneously see or access data related to the parent table. You can create a subform along with its parent table using the form wizard. You can also use of of the related table as a subform. In Microsoft Access 2000, you can also create a table when using the New Object:AutoForm feature. Using the Silver National Bank database, we will make sure the user can view and even process bank transactions from the subform.
Open the Silver National Bank3 database.
1.
Click the Forms object or tab. Click the New button. Choose Design View and base the form tblTransactions.
2.
Right-click on the form and choose Form Header/Footer. In the Header section, place 6 labels as:
#, Date, Type, Deposit, W/D Amt, Charge.
3.
Drag TransactionNumber, TransactionDate, TransactionTypeID, DepositAmount,
WithdrawalAmount, ServiceCharge to the Detail section. Every time you drop a text box, delete its label, place the text box to the very top under its corresponding header label.
4.
Save the form as sbfAccounts.
5.
Access the subform's Properties. Set the Navigation Buttons field to No.
6.
To perform some calculations about an account's transactions, we need to regularly update a customer's routine transactions: deposits, withdrawals, service charges, etc. Click the Text Box on the Toolbox, click to the left of the Footer section, delete the label of the new Text Box, resize the Text Box to roughly 2 divisions (the user will not see/use it). On the Properties dialog, change the name of the text box to TotalDeposits, and set its Control Source to =Sum([DepositAmount]). Drop another Text Box to the right of the TotalDeposits.
Delete its label, shrink or narrow it, change its name to TotalWithdrawals, and its Control Source to =Sum([WithdrawalAmount]). Add one more Text Box to the right of the existing text boxes in the Footer section. Delete its label and shrink it, change its name to
TotalServiceCharges, and set its Control Source to =Sum([ServiceCharge]).
7.
Add one last Text Box on the right of the Footer section. Change the name of its label to lblBalance and the Caption of its label to Balance:. Change the name of the Text Box to Balance, and its Control source to:
=nz([TotalDeposits])-nz([TotalWithdrawals])-nz([TotalServiceCharges]) 8.
Select the first three text boxes (TotalDeposits, TotalWithdrawals, and
TotalServiceCharges). On the Properties dialog, set their Visible field to No. Select all the text boxes in the Footer section and set their Format to Currency.
9.
Before leaving, drag AccountID from the Field List to the Header section of the form (you can drop it anywhere) and set its Visible field to No. Save and close the subform.
10.
In Design View, create a form based on the tblAccounts. Save the form as frmAccounts.
11.
Open the frmAccounts2 form in Design View. On the Toolbox, click the Page Break control and click in the Detail section far left but right on 2 1/4.
12.
Make sure the Control Wizard on the Toolbox is pressed. On the Toolbox, click the Subform/Subreport control. Click on the form under the page break. In the first page of the Subform/Subreport Wizard, click the Forms combo box and choose sbfAccounts1. Click Next, Next, and Finish. Switch to Form View.
13.
On the main menu, click Window -> Size to Fit Form. Close the form.
14.
Open the frmAccounts3 form.
15.
Click Control Wizard button on the Toolbox to deselect it. On the form, scroll down completely to see the Footer section.
16.
On the Toolbox, click Command Button. Click under the footer bar at 1 inch of the horizontal ruler. On the Properties dialog, change the button's name to DetailsBtn and its Caption to &Details. Drop another button on the right of the first button, change its name to TransactionsBtn and its Caption to &Transactions.
17.
Right-click the Details button and choose Build Event... In the Choose Builder dialog, click Code Builder and click OK. Implement the procedure as follows:
Private Sub DetailBtn_Click() Me.GoToPage 1
End Sub 18.
In Microsoft Access, right-click the other button, choose Build Event... and double-click Code Builder. Implement the procedure as follows:
Private Sub TransactionsBtn_Click() Me.GoToPage 2
End Sub 19.
Close Visual Basic. Switch the form to Form View. If necessary, on the main menu, click Window -> Size to Fit Form. Click the buttons in the footer section and make sure they allow you to access the top and bottom section of the form. Save the form.
20.
Close the Silver National Bank3 database.
21.