Can someone help me with a tricky thing I'm trying to figure out?
I am not a programmer.
I have an order entry screen. We sell products by the case and by the unit. The default price for the item would be case price but we need a way to switch the price to the unit price. I thought maybe a drop-down that would allow the user to select "unit" and then the "unit" selling price would auto populate the price field? Maybe there is a better way, I don't know. Maybe a checkbox that if selected runs some vba that that changes the value in the price field from case price to unit price?
All of the data (unit price/case price) is in the tblItemMaster table.
Using a combo box, the user enters or selects the item and then the selling price (from one of the item combo columns) is auto populated into the price field. The following happens:
Me![InvoiceItemUnitPrice] = Nz(Me![cboDesc].Column(7), 0)
UpdateLine
I've posted the UpdateLine Code Below
I need some easy way for the data entry person to specify whether we're selling a unit or a full case the default being full case.
If someone could help, I would be very very grateful and I'll write a very nice review!
Select Case Nz(PricingMethod, 0)
Case 0 'don't charge tax
Me![InvoiceItemNetAmount] = MyRound((Nz(Me![InvoiceItemUnitPrice], 0) * Nz(Me![InvoiceItemQuantity], 0)) * (1 - Nz(Me![InvoiceItemDiscount], 0)), 2)
Me![InvoiceItemTaxAmount] = Null
Me![InvoiceItemTotalAmount] = Nz(Me![InvoiceItemNetAmount], 0)
Case 1 'Prices EXCLUDE tax (calc net and add tax)
Me![InvoiceItemNetAmount] = MyRound((Nz(Me![InvoiceItemUnitPrice], 0) * Nz(Me![InvoiceItemQuantity], 0)) * (1 - Nz(Me![InvoiceItemDiscount], 0)), 2)
Me![InvoiceItemTaxAmount] = MyRound(Nz(Me![InvoiceItemNetAmount], 0) * Nz(Me![InvoiceItemTaxPercent], 0), 2)
If Me![InvoiceItemTaxAmount] = 0 Then
Me![InvoiceItemTaxAmount] = Null
End If
Me![InvoiceItemTotalAmount] = Nz(Me![InvoiceItemNetAmount], 0) + Nz(Me![InvoiceItemTaxAmount], 0)
Case 2 'Prices INCLUDE tax (calc gross and determine tax amount)
Me![InvoiceItemTotalAmount] = MyRound((Nz(Me![InvoiceItemUnitPrice], 0) * Nz(Me![InvoiceItemQuantity], 0)) * (1 - Nz(Me![InvoiceItemDiscount], 0)), 2)
Me![InvoiceItemNetAmount] = MyRound(Me![InvoiceItemTotalAmount] / (1 + Nz(Me![InvoiceItemTaxPercent], 0)), 2)
Me![InvoiceItemTaxAmount] = Nz(Me![InvoiceItemTotalAmount], 0) - Nz(Me![InvoiceItemNetAmount], 0)
If Me![InvoiceItemTaxAmount] = 0 Then
Me![InvoiceItemTaxAmount] = Null
End If
End Select