Hi
I'd appreciate help on the following issue - can't find the solution myself.
Goal of my Database: Recording bank transaction (money transfers from one account to another)
Details: On the form on which I record these transaction I have two combo-boxes: 1)Account Debited and 2)Account Credited.
Both combo-boxes have the same source, which is an Active-Account-Query.
I have the following code to avoid Account Credited and Account Debited to be the same:
Private Sub ctlCreditAccountNumber_BeforeUpdate(Cancel As Integer)
If Me.ctlCreditAccountNumber = Me.ctlDebitAccountNumber Then
MsgBox "The Credited account must be " _
& vbCrLf & " DIFFERENT" _
& vbCrLf & "than the Debited account!", _
vbInformation, "Inconsistency"
Cancel = True
End If
End Sub
This code works fine, but the problem I have is, that when the focus returns to the combobox ctlCreditAccountNumber, the account number I've entered just before (and which is wrong) is still there. I would like the combobox to be clear of any text, after the message box disappears.
I have tried putting the rowsource to "", I have tried = Null, and Undo but nothing works. From what I gather, the reason for that is that the combobox is a bound field. That is something I can't change though.
Any solutions?
Any help would be greatly appreciated.