How can I Recreate this macro function to Code as a click event Procedure. After splitting the database the macro seen below did not work on the macro function used to call the CalculateAllLateFees on a form. I need a help to rewrite the code to event procedure thanks
--------------------------------------------------------------------------------------------------
' Find all the Overdue loans
For Each Record In Loan
Where Condition = [Loan].[DueDate]+1<Now() And IsNull([Loan].CheckedIn])
Alias OverdueLoan
'/ Compute the number of days overdue
SetLocalVar
Name daysOverdue
Expression = Date()-[Overdueloan].[DueDate]
'/ Get the daily late fee, which is defined in the Media
LookUp A Record In InventoryItem
Where Condition = [InventoryItem].[InventoryItemID]=[OverdueLoan].[InventoryItemID]
Alias InventoryItem
Look Up a Record Item
Where Condition = [Item].[Item]=[InventionItem].[ItemID]
Alias Item
Look Up A Record in Media
Where Condition = [Media].[MediaID]=[Item].[MediaID]
Alias Media
'/Compute the total fee and store in the loan table
EditRecord
Alias OverdueLoan
setField
Name OverdueLoan.OverdueFee
Value = [daysOverdue]*[Media].[OverdueFee]
End EditRecord
--------------------------------------------------------------------------------------------------
' Find all the Overdue loans
For Each Record In Loan
Where Condition = [Loan].[DueDate]+1<Now() And IsNull([Loan].CheckedIn])
Alias OverdueLoan
'/ Compute the number of days overdue
SetLocalVar
Name daysOverdue
Expression = Date()-[Overdueloan].[DueDate]
'/ Get the daily late fee, which is defined in the Media
LookUp A Record In InventoryItem
Where Condition = [InventoryItem].[InventoryItemID]=[OverdueLoan].[InventoryItemID]
Alias InventoryItem
Look Up a Record Item
Where Condition = [Item].[Item]=[InventionItem].[ItemID]
Alias Item
Look Up A Record in Media
Where Condition = [Media].[MediaID]=[Item].[MediaID]
Alias Media
'/Compute the total fee and store in the loan table
EditRecord
Alias OverdueLoan
setField
Name OverdueLoan.OverdueFee
Value = [daysOverdue]*[Media].[OverdueFee]
End EditRecord