I have a main form and subform (Invoice Header and detail).The detail consist of a Item,quanity,sell price and extended price. All items are entered into fields in the underlying query except Ext price which is a calculated field. In the bottom of the header I have a subtotal control (Calculated) a state tax rate field and a state tax amount (Both fields in main form query). As the user adds rows in the subform, the subtotal field is automatically updated because it is calculated. HOwver the state tax amt field is not so I am trying to run VB code to update the sales tax amount after each detail record is updated. I tried using (Forms![Invoices]![StateSalesTaxAmt] = Forms![INvoices]![SalesTaxRate] * Forms![Invoices]![Subtotal] on the after update property on the subform. For some reason this does not work. I even created 2 queries that did the same thing and it worked. Only problem is When I do it I have to repaint the form before the values will show which brings the record pointer back to the first row which is not good on a long invoice. I then added gotolastrecord in VB this worked great when you were adding a new invoice. However when you edit an invoice and start to add lines, the same code runs but it goes back to the first row in the subform which makes it hard on the user. The only diffrence I see is that the main form when opened from the ADD button it is in data entry where as the edit button opens it in filtered mode because you need to edit the invoice you picked from the invoices combo box.
What am i doing wrong I would appreciate any help with this. Also I could ftp the code to someone to give them more to look at to solve this problem.
Thanks
What am i doing wrong I would appreciate any help with this. Also I could ftp the code to someone to give them more to look at to solve this problem.
Thanks