Microsoft Access VBA Macro Programming

(Tina Sui) #1

Use the Create Record In option to select your second table (tblTableMacroCopy). Click
the Add New Action field within the gray box for this action and select SetField.
Enter the field name asNumber2Copy(the single numeric field that you included in your
new table), and the value as[tblTestTableMacro].[Number2].
Your design window will now look like Figure 13-6.
Save the macro and the table using the save icons, close the Data Macro window and then
open your original table (tblTestTableMacro) in View mode. Add a new record by populating
the Number1 field. You will see that the Number2 field is still calculated, but if you also open
your second table (tblTableMacroCopy), you now have a new record in it based on the record
you entered in the first table.
This is a demonstration of the possibilities of the table macros. It is a shame you cannot
use VBA here and instead must use the pseudo-macro language, but it still provides a new
dimension to your application.


Chapter 13: Table Macros 171


Figure 13-6 Design window with Create Record action added

Free download pdf