If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Check For Existing Record
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 |
Thread Tools | |
Display Modes | |
|
|