I search for way to correct result in message box
when show message box I would deal minus amount in textbox1 as plus amount even the real amount is minus in textbox1.
example :Abed name contains minus value =-2,000.00 when select name from combobox1 and when write in textbox2 =300.00 then will not show message box because I consider minus value as plus value in textbox1 then will not show message box as long amount in textbox1>textbox2 based on message box , the problem will deal minus value in this case will show message box consider textbox1<textbox2 despite of I use Abs function!
also when select Abdo from combobox1 will populate amount in textbox1=2,000.00 and when write in textbox2 =2,000 then should not show message box because will equal zero , , the problem will show message box showing value is zero.
so two cases need fixing after change minus value to plus value in textbox1
1- if textbox> textbox2 then doesn't show message like textbox1=-3000,textbox2=2000 so when change textbox1 to plus when show message box then textbox1=3000 > textbox2= 2000 so no need show message.
2- if textbox1=textbox2 then doesn't show message like textbox1=-2000 textbox2=2000 when change textbox1 to plus when textbox1=2000 = textbox2= 2000 and 2000-2000=0 so no need show message
and when there is no minus value in both textboxes like
1- when there is no minus value for both textboxs but the result will be minus value like
textbox1=2000, textbox2=3000 so 2000-3000=-1000 will show plus 1000 in message box.
2- when there is the same value for both textboxes and result=0 then shouldn't show message like textbox1=2000,textbox2=200 so 2000-2000=0
here is what I try when fill in textbox2 what message should show.
Private Sub TextBox2_AfterUpdate()
Dim tot As Double
tot = CDbl(Abs(TextBox1.Value)) - CDbl(TextBox2.Value)
If TextBox1.Value < TextBox2.Value Then MsgBox " bigger than available , so you have plus amount about" & " " & Format(Abs(tot), "#,##0.00")
End Sub
I'm talking about changing from minus to plus just when show message , don't change in textboxes.
Bookmarks