Hi guys Ive got a from with 4 textboxes on it, cost,selling,m/up,gp
when i enter cost and selling it works out the gp and m/up
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Selling.TextChanged
Try
mup.Text = Format(Val((Selling.Text) - Val(Cost.Text)) / Val(Cost.Text) * 100, "0.00")
gp.Text = Format(Val((Selling.Text) - Val(Cost.Text)) / Val(Selling.Text) * 100, "0.00")
Catch ex As Exception
End Try
End Sub
this works but now i want the selling,gp and m/up to change when i change the gp and i cant seem to get that working
i've got the Fromula for that but i keep getting errors or it doesn't change
this is the second part
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gp.TextChanged
Try
'selling = cost * (1 + m/up%)
Selling.Text = Val(Cost.Text) * (1 + Val(mup.Text) / 100)
Catch ex As Exception
End Try
End Sub
any help would really be appreciated
thanks
Loading
PJ MartinsPosted Jun 18, 2010, 10:36 AM
Selling.Text = 100 * Val(Cost.Text) / (100 - Val(gp.Text));
See if that gives you what you're looking for.
Ryan steenkampPosted Jun 18, 2010, 2:44 AM
if i get that working i can do the same for gp and m/up
when i run the application and enter a value into cost and selling it generates my m/p and gp and it works but now i need to reverse that when i change the gp it should change my selling acording to the formule in text4_changed but it doesn't work, it does'nt change because i state that gp's text should be this gp.Text = Format(Val((Selling.Text) - Val(Cost.Text)) / Val(Selling.Text) * 100, "0.00") now if try and type a different value in there it doesn't do anything because i toldit to be this gp.Text = Format(Val((Selling.Text) - Val(Cost.Text)) / Val(Selling.Text) * 100, "0.00") so it keeps going back to the original value
hope this is clear thanks foryour reply. :-)
PJ MartinsPosted Jun 17, 2010, 4:58 PM