Hi,
I am new to Access. I entered the following code, but I'm getting a compile error over the ".Access_Bar_Code"
Code:
Private Sub Access_Bar_Code_BeforeUpdate(Cancel As Integer)
Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
SID = Me.Access_Bar_Code.Value
stLinkCriteria = "[Access Bar Code]=" & "'" & SID & "'"
'Check Legal Files table for duplicate Access Bar Code
If DCount("Access_Bar_Code", "Legal Files", _
stLinkCriteria) > 0 Then
'Undo duplicate entry
Me.Undo
'Message box warning of duplication
MsgBox "WARNING: " _
& SID & " has already been entered." _
& vbCr & vbCr & "You will now been taken to that record.", _
vbInformation, "Duplicate Information"
'Go to record of original Access Bar Code
rsc.FindFirst stLinkCriteria
Me.Bookmark = rsc.Bookmark
End If
Set rsc = Nothing
End Sub
If somebody can help me, that will be great.
Thank you very much.