Hello,
Fairly new to VB Access. Here's the issue: I have an expense field that is on the main form and an allocation amount on a subform. Code from buttons to update the allocation amount works well. BUT I'm trying to code it so it will not allow you to update the allocation amount for more than the expense amount. I did create a sum field in the subform footer which feeds a totalssum field on the main form and thought having statement look at the two fields and compare was best but for the life of me cannot figure it out.
Here's what I have so far and any and all help is greatly appreciated.
Fairly new to VB Access. Here's the issue: I have an expense field that is on the main form and an allocation amount on a subform. Code from buttons to update the allocation amount works well. BUT I'm trying to code it so it will not allow you to update the allocation amount for more than the expense amount. I did create a sum field in the subform footer which feeds a totalssum field on the main form and thought having statement look at the two fields and compare was best but for the life of me cannot figure it out.
Here's what I have so far and any and all help is greatly appreciated.
Code:
DoCmd.RunSQL "INSERT INTO tblallocation ( CountyID, ExpenseID, AllocationAmt ) SELECT tblREFCountyNames.CountyID, [Forms]![frmtab].[ExpenseID] AS ExpenseID, [Forms]![frmtab].[Expense]/23 AS Expense FROM tblREFCountyNames WHERE (((tblREFCountyNames.CountyID) In (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23)))"
Comment