After Update

  • Thread starter stephendeloach via AccessMonster.com
  • Start date
S

stephendeloach via AccessMonster.com

In my form i have a subform, In the subform I have a check box that when
checked needs to multiply the UnitPrice by Expendable and when unchecked the
UnitPrice needs to return to original price. As of now this is the
AfterUpdate command..

Private Sub Expendable_AfterUpdate()

If Me!Expendable = True Then
Me!UnitPrice = Nz(Me!UnitPrice, 0) * 1.1
Else
Me!UnitPrice = Nz(Me!UnitPrice, 0) / 1.1

End If
End Sub

I need to change it because sometimes the expandable will be more than 10%. I
have added an Expendables field in the main form (Table1). I would think this
would be what I am looking for but i really dont have a clue what I am doing!.
..

Private Sub Expendable_AfterUpdate()

If Me!Expendable = True Then
Me!UnitPrice = Nz(Me!UnitPrice, 0) * [Expendable]
Else
Me!UnitPrice = Nz(Me!UnitPrice, 0) / [Expendable]

End If
End Sub



am i close??
 
B

Bob Quintal

After playing around with it I have added the exp field to the
subform. This is where I enter the percentage. Then in the
after update of the of the Expendable field i have this..

Private Sub Expendable_AfterUpdate()

If Me!Expendable = True Then
Me!UnitPrice = Nz(Me!UnitPrice, 0) * [exp]
Else
Me!UnitPrice = Nz(Me!UnitPrice, 0) / [exp]

End If
End Sub

which gives me the precentage of the unitprice.. but I need
the precentage of the unitprice to be ADDED to the
unitprice... how would i do this?

If Me!Expendable = True Then
Me!UnitPrice = Nz(Me!UnitPrice, 0)+ Nz(Me!UnitPrice, 0) * [exp]
Else
Me!UnitPrice = Nz(Me!UnitPrice, 0)- Nz(Me!UnitPrice, 0) / [exp]
End if
 
S

stephendeloach via AccessMonster.com

After playing around with it I have added the exp field to the subform. This
is where I enter the percentage. Then in the after update of the of the
Expendable field i have this..

Private Sub Expendable_AfterUpdate()

If Me!Expendable = True Then
Me!UnitPrice = Nz(Me!UnitPrice, 0) * [exp]
Else
Me!UnitPrice = Nz(Me!UnitPrice, 0) / [exp]

End If
End Sub

which gives me the precentage of the unitprice.. but I need the precentage of
the unitprice to be ADDED to the unitprice... how would i do this?
In my form i have a subform, In the subform I have a check box that when
checked needs to multiply the UnitPrice by Expendable and when unchecked the
UnitPrice needs to return to original price. As of now this is the
AfterUpdate command..

Private Sub Expendable_AfterUpdate()

If Me!Expendable = True Then
Me!UnitPrice = Nz(Me!UnitPrice, 0) * 1.1
Else
Me!UnitPrice = Nz(Me!UnitPrice, 0) / 1.1

End If
End Sub

I need to change it because sometimes the expandable will be more than 10%. I
have added an Expendables field in the main form (Table1). I would think this
would be what I am looking for but i really dont have a clue what I am doing!.
..

Private Sub Expendable_AfterUpdate()

If Me!Expendable = True Then
Me!UnitPrice = Nz(Me!UnitPrice, 0) * [Expendable]
Else
Me!UnitPrice = Nz(Me!UnitPrice, 0) / [Expendable]

End If
End Sub

am i close??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top