Hi Guys,
Just a quick query which I hope is going to be fairly straightforward. I have a form in which users enter a few fields, one being DebtGenerated(£) and the other being DebtCollected(£). What I am trying to do is add an AfterUpdate section of code which, once the DebtCollected(£) is completed, will compare this to the DebtGenerated, and if the DebtCollected exceeds that generated, a MsgBox will pop up.
I am struggling with this at the moment, but am not sure quite what the problem is. I have tried my code and changed whether the fields are classed as numbers or currency, neither of which makes any difference. My code is below and any help would be much appreciated. Thanks in advance!
Dan
Just a quick query which I hope is going to be fairly straightforward. I have a form in which users enter a few fields, one being DebtGenerated(£) and the other being DebtCollected(£). What I am trying to do is add an AfterUpdate section of code which, once the DebtCollected(£) is completed, will compare this to the DebtGenerated, and if the DebtCollected exceeds that generated, a MsgBox will pop up.
I am struggling with this at the moment, but am not sure quite what the problem is. I have tried my code and changed whether the fields are classed as numbers or currency, neither of which makes any difference. My code is below and any help would be much appreciated. Thanks in advance!
Dan
Code:
Private Sub Debt_Collected__Cancellation__Change()
If [DebtCollected(£)].Value > [DebtGenerated(£)].Value Then
MsgBox "Debt Collected cannot exceed Debt Generated.", vbOKOnly
Me![DebtGenerated(£)].SetFocus
End If
End Sub