Calculate different values for each datasheet row

treva26

Registered User.
Local time
Today, 00:54
Joined
Sep 19, 2007
Messages
113
I have a subform in datasheet view.
On the AfterUpdate code the Markup field, it recalculates the ItemSell & GM1

Like so:

Code:
Private Sub markup1_AfterUpdate()

'calc sell and margin(gm)
Me.ItemSell = Round((Me.ItemCost * (Me.markup1 / 100)) + Me.ItemCost, 0)
Me.GM1 = Round(((Me.ItemSell - Me.ItemCost) / Me.ItemSell) * 100, 0)

End Sub

The problem is it puts the new values for markup1 and GM1 in all of the rows.
I want each row to have a seperate value for markup1 & GM1

What am I doing wrong?
Or is it not possible?
 
Sorry, I figured it out.

The ones that were all changing were unbound.

I added a field in the table for them (although its not really used for anything) and now they can all have different values!

:)
 

Users who are viewing this thread

Back
Top Bottom