I am using a userform to input accounts and amounts into a ledger. How can I make sure that individual account amounts match the invoice total and if not let the user know so that the user can check the input before the userform posts to the ledger?
I've tried inserting a separate module and used this code:
Sub CheckData()
If Textbox1.Value = Textbox2.Value + Textbox3.Value + Textbox3.Value + Textbox4.Value Then
Exit Sub
Else MsgBox ("Please check your input, account s and invoice don't match!")
End IF
End Sub
I called this module before the posting of the information but it didn't work. It posted it anyway not matter if the totals matched or not.
Thanks,
I've tried inserting a separate module and used this code:
Sub CheckData()
If Textbox1.Value = Textbox2.Value + Textbox3.Value + Textbox3.Value + Textbox4.Value Then
Exit Sub
Else MsgBox ("Please check your input, account s and invoice don't match!")
End IF
End Sub
I called this module before the posting of the information but it didn't work. It posted it anyway not matter if the totals matched or not.
Thanks,