Hi
I have tried using this in the before update event of ChqRecNo on a form, it is getting stuck at [Forms]![frm_DataForm_ChqRec]![ChqRecNo] = "" giving the error message
Runtime error 2115
The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Office Access from saving the data in the field
Private Sub ChqRecNo_BeforeUpdate(Cancel As Integer)
If DCount("ChqRecNo", "tbl_DataStore", "ChqRecNo = " & [Forms]![frm_DataForm_ChqRec]![ChqRecNo]) Then
MsgBox "That Cheque Rec Number already exists"
[Forms]![frm_DataForm_ChqRec]![ChqRecNo] = ""
[Forms]![frm_DataForm_ChqRec]![ChqRecNo].SetFocus
End If
End Sub
Woudl anyone be able to help work out the problem or suggest a better way to do this...as always many thanks in advance...cheers Fi
I have tried using this in the before update event of ChqRecNo on a form, it is getting stuck at [Forms]![frm_DataForm_ChqRec]![ChqRecNo] = "" giving the error message
Runtime error 2115
The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Office Access from saving the data in the field
Private Sub ChqRecNo_BeforeUpdate(Cancel As Integer)
If DCount("ChqRecNo", "tbl_DataStore", "ChqRecNo = " & [Forms]![frm_DataForm_ChqRec]![ChqRecNo]) Then
MsgBox "That Cheque Rec Number already exists"
[Forms]![frm_DataForm_ChqRec]![ChqRecNo] = ""
[Forms]![frm_DataForm_ChqRec]![ChqRecNo].SetFocus
End If
End Sub
Woudl anyone be able to help work out the problem or suggest a better way to do this...as always many thanks in advance...cheers Fi