Hi Richard, You did not understand my previous question, so I will here try to clarify it a bit more. Here is my program:
Private Sub Kommandoknap9_Click() LogIt "Price Updated", "Category" & CategoryCombo.Column(1) If IsNull(CategoryCombo) Or IsNull(Markup) Then Exit Sub Dim M M = Format(Markup, "0,00") DoCmd.SetWarnings False DoCmd.RunSQL "UPDATE ProductT INNER JOIN VendorProductT ON " & _ "ProductT.ProductCode = VendorProductT.PRID " & _ "SET ProductT.UnitPrice = [PPRICE]*(1+" & M & "), " & _ "ProductT.LastUpdated = Now() " & _ "WHERE ProductT.Category=" & CategoryCombo DoCmd.SetWarnings True RefreshProductList End Sub
When VendorPriceUpdateF, Markup stands at 45%, nothing happens. When VendorPriceUpdateF, Markup stands at 50% is the Unit Price 100% bigger than the New Price. When VendorPriceUpdateF, Markup stands at 51% to 99 % is the Unit Price 100% bigger than the New Price. When VendorPriceUpdateF, Markup stands at 150% is the Unit Price 300% or three times larger than the New Price. Kind regards Lone
Reply from Richard Rost:
Make sure you DIM M as something. In this case, you probably want a DOUBLE. Don't bother formatting it, you're not displaying it anywhere.
Where is PPRICE coming from? If that's in the tutorial, I apologize, it's been two years since I recorded that lesson. Can't remember everything. :)
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
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 SQL Seminar Part 2.