M
mcnews
i am trying to keep the user from adding a new record if an error
occurs on the current new record.
i used the following code but it doesn't get me there:
Private Sub UniqueID_AfterUpdate()
If UniqueID.Value = SpecimenID.Value Then
Dim longRec As Long
longRec = Me.Recordset("ID")
MsgBox "You scanned the same barcode twice!", vbCritical, "Scan
Error"
DoCmd.GoToRecord , , acGoTo, longRec
UniqueID.SetFocus
End If
End Sub
even tho longRec contains the correct record number and executing the
goto from the command window works.
?
tia,
mcnewsxp
occurs on the current new record.
i used the following code but it doesn't get me there:
Private Sub UniqueID_AfterUpdate()
If UniqueID.Value = SpecimenID.Value Then
Dim longRec As Long
longRec = Me.Recordset("ID")
MsgBox "You scanned the same barcode twice!", vbCritical, "Scan
Error"
DoCmd.GoToRecord , , acGoTo, longRec
UniqueID.SetFocus
End If
End Sub
even tho longRec contains the correct record number and executing the
goto from the command window works.
?
tia,
mcnewsxp