, . , .
Access .
DSum . .
DAvg . .
DCount . , .
DMin DMax . .
DFirst DLast . , .
DLookup , . ID.
. ( ), . . , . , Boutique Fudge, Price ( ), Products ( ) , Beverages () ( ).
DSum. OrderDetails, , OrderlD . , . , Price Quantity.
, :
=DSum("Price*Quantity","OrderDetails","OrderID=" & [ID])
, . . , . (ID) 455, OrderDetails, OrderID=4 55. Format, , .
, . Access . , . Form.Recalc, OrderDetails , . , :
|
|
Private Sub Form_Afterlnsert()
Forms("PlaceOrder").Recalc
End Sub
Private Sub Form_AfterUpdate()
Forms("PlaceOrder").Recalc
End Sub
Private Sub Form_AfterDelConfirm(Status As Integer)
Forms("PlaceOrder").Recalc
End Sub
, .
5, - , , . , ("" " "). , , . , OrderDetails .
. . ProductID OrderDetails. Products .
, . On Change () ProductID, . DLookup Price . , :
Private Sub ProductID_Change ()
Price = DLookup("Price", "Products", "ID=" & ProductID)
Quantity =1
End Sub
1 Quantity, . , Price Quantity , . , (Locked) Price, 1 ( Boutique Fudge). , , .
. . DLookup . cophone Music , .