Database Reference
In-Depth Information
Table Tools Table
tab contains options for
creating data macros
145
OrderLine table in
Datasheet view
FIGURE 4-28
Using data macros to create triggers for the OrderLine table
When a user adds a record to the OrderLine table, a data macro, which is associated with the After Insert
event for the OrderLine table, is executed. The data macro must update the OnOrder value for the corre-
sponding part to reflect the new record in the OrderLine table. For example, if the value in the OnOrder field
for part CD52 is four and the user adds an order line on which the part number is CD52 and the number
of units ordered is two, six units of part CD52 are on order. When a record is added to the OrderLine table,
the data macro updates the Part table by adding the number of units ordered on the order line to the
previous value in the OnOrder field. You create a data macro by adding actions to it using the Macro
Designer. Figure 4-29 shows the data macro associated with the After Insert event for the OrderLine table.
After Insert event for
the OrderLine table
Click to display or hide
the Action Catalog pane
Actions
Arguments
Double-click or drag an
item in the Action Catalog pane
to add it to the data macro
Block contains
actions
FIGURE 4-29
Macro Designer window for the After Insert event associated with the OrderLine table
Search WWH ::




Custom Search