My solution for computing the correct tax rate per product works but now Im faced with customers who are not taxable and/or not charged service charge/service charge tax.
This is accomplished with VBA code which provides Dlookuo values with IF THEN statement. The code in on the OrderF (main form) as an AfterUpdate event procedure. This works perfectly when adding a new proposal and entering items into the Order DetailF (sub form).
The problem lies when editing the sub form, OrderDetailF. I must click on the main form OrderF first in order for the Dlookup VBA code to populate the values.
How can write code to fix this?
Lesli CochranOP
@Reply 3 years ago
Also, the code is based on the customer I'd already being loaded onto the OrderF so Onload and OnActive ever procedures resulted in errors because the code could t reference the CustomerID as it wasn't loaded into the form yet.
Lesli CochranOP
@Reply 3 years ago
Code on OrderF as AfterUpdate Event
Dim TX As String, CF As String, SCTX As String, SC As String, SCR As String
If CF = True Then
SalesTaxRate = TX
Else
SalesTaxRate = 0
End If
If CF = True Then
ServiceChargeTaxRate = SCTX
Else
ServiceChargeTaxRate = 0
End If
If SC = True Then
ServiceChargeRate = SCR
Else
ServiceChargeRate = 0
End If
Lesli CochranOP
@Reply 3 years ago
I added code to the CustomerF AddOrder button which DIM the controls on the OrderF and executed the code from the button. Then I added this code to OnCurrent OrderF with the On Error Resume Next to handle when the form is loaded from CustomerF.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Developer 25.