View Full Version : Code to enable Price Modification


BobJ
05-16-2007, 03:01 AM
Hi,

i have my inputmedia record source set to a query called Order Details Extended in which there is a column with the following in it:

ExtendedPrice: CCur(InputMedia.iCostPerUnit*[iQuantity]*(1-[iDiscount])/100)*100

which is fine, but im trying to find a way to enable price modification so the default values in my tables dont change.. so i created a new field called ModPrice and in the AfterUpdate section i entered the following code, so that if you enter a value in the ModPrice then the following will happen:

Private Sub ModPrice_AfterUpdate()
If Me.ModPrice Is Not Null Then
Me.ExtendedPrice = CCur(Me.ModPrice * Me.iQuantity * (1 - Me.iDiscount) / 100) * 100
End If
End Sub

However this isnt working is it a problem with the code or is what im attempting to do not possible?

Cheers.

RuralGuy
05-16-2007, 04:46 AM
If Len(Me.ModPrice & "") > 0 Then

BobJ
05-16-2007, 06:19 AM
thanks for tryin to help, didn't work, so i created a new field for prices that will be modified all fixed now!

RuralGuy
05-16-2007, 06:29 AM
Glad you got it sorted. Is Null and Is Not Null are for SQL. The IsNull() function works in VBA.