I have a combo box which is validated in the Before update event. If the value is invalid I want to revert to the original value, as if the user pressed ESC once.
I currently have:
Private Sub cboReportingSet_BeforeUpdate(Cancel As Integer)
'verify that this group has same currency as others in this set
Dim rs As Recordset
Set rs = DB.OpenRecordset("Select * from [List_Of_Group/Division] where ReportingSet='" & Me.cboReportingSet & "'", dbOpenDynaset)
If rs.RecordCount > 0 Then
If Nz(rs!ReportingCurrency, "") <> Nz(Me.txtReportingCurrency, "") Then
MsgBox "You can't use this reporting set for this group. Another group in this set has a conflicting currency. All groups within a set must have same currency."
rs.Close: Set rs = Nothing
The undo does not remove the new value. So, if it was originally A, user changes it to B, and this is not valid, I want to set value back to A. How do I do this?