S
sike11 via AccessMonster.com
Good morning all,
I have the following code in my BeforeUpdate and I keep getting the same
error: Run time error 2001 - You have cancelled the previous operation. I am
unsure as to what I have cancelled. Can someone please help me?
Private Sub txtQualref_BeforeUpdate(Cancel As Integer)
Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
SID = Me.txtQualref.Value
stLinkCriteria = "me.txtQualref =" & "'" & SID & "'"
'Check tblQOEDescription for duplicate entries
If DCount("QoE-" & "me.txtQualref", "tblQOEDescription",
stLinkCriteria) > 0 Then
Me.Undo
'Message box warning of duplication
MsgBox "Warning This Control " & SID & " has already been
entered." & vbCr & vbCr & _
"You will now be taken to the record.", vbInformation,
"Duplicate Information"
'Go to record of original control
rsc.FindFirst stLinkCriteria
Me.Bookmark = rsc.Bookmark
End If
Set rsc = Nothing
End Sub
Thanks in advance.
Mary.
I have the following code in my BeforeUpdate and I keep getting the same
error: Run time error 2001 - You have cancelled the previous operation. I am
unsure as to what I have cancelled. Can someone please help me?
Private Sub txtQualref_BeforeUpdate(Cancel As Integer)
Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
SID = Me.txtQualref.Value
stLinkCriteria = "me.txtQualref =" & "'" & SID & "'"
'Check tblQOEDescription for duplicate entries
If DCount("QoE-" & "me.txtQualref", "tblQOEDescription",
stLinkCriteria) > 0 Then
Me.Undo
'Message box warning of duplication
MsgBox "Warning This Control " & SID & " has already been
entered." & vbCr & vbCr & _
"You will now be taken to the record.", vbInformation,
"Duplicate Information"
'Go to record of original control
rsc.FindFirst stLinkCriteria
Me.Bookmark = rsc.Bookmark
End If
Set rsc = Nothing
End Sub
Thanks in advance.
Mary.