Hi all,
I am trying to prevent a duplicate value on a subform if a dup value is entered and if it has the same ID field as the previous subform ID.
Code is:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If DLookup("[SystemPrimaryRole]", "tblSystemPrimaryRole", [SystemPrimaryRole] > 0 And [SystemPrimaryIndustryID] = Me.TxtSystemPrimaryIndustryID) Then
MsgBox "This Primary Role Value has all ready been entered"
Me.Undo
Exit Sub
End If
End Sub
Data base is attached, opens to form in question. If you type in Lodging in second subform, it should not allow it but getting error 13?
Can I get some assistance witht this please?
Thannks
Dave
SystemIndustryData.zip