Can you please explain "Domain Function".
"ruralguy via AccessMonster.com" wrote:
Usually verification code is placed in the BeforeUpdate event of a control
using a Domain function to look for duplicates.
ridgerunner wrote:
I have a unique index set on two fields in my table, InspDate and StoreNo. I
am trying to trap the error of attempting to add a duplicate by having the
code below in the LostFocus Event for the InspDate. I am running around in
circles. Can someone please help?
Private Sub InspDate_LostFocus()
If DMInspections.StoreNo = True Then
ElseIf DMInspDet.InspDate = True Then
MsgBox "Store and Inspection Date already exist. Please correct"
Me.InspDate.SetFocus
Else: Me.DMnameID.SetFocus
Exit Sub
End If
End Sub
tia
ridgerunner
--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.
Message posted via http://www.accessmonster.com