P
Playa
Can you not use the DLookup function on a Primary Key field? Every time I
push the save button on a data entry form the Access Error '3202'
.....duplicate values in primary key...... appears instead of my message box
from my if statement which is suppose to be checking for the duplicate
values. My if statement is....
Dim varResult As Variant
'strWhere = "DrawingNum = " & Me.DrawingNum
Me.DrawingNum.SetFocus
varResult = DLookup("DrawingNum", "tbl_DrawingsAndData", _
"DrawingNum = '" &
Me.DrawingNum & "'")
If Not IsNull(varResult) Then
strMsg = "Drawing " & varResult & " Already Exists."
End If
I have been on this problem for two days now and for the life of me can't
figure out what is going on. I am not that dumb and everyone says to use the
DLookup to check for the duplicates so I am thinking maybe you can't for
Primary Keys.
push the save button on a data entry form the Access Error '3202'
.....duplicate values in primary key...... appears instead of my message box
from my if statement which is suppose to be checking for the duplicate
values. My if statement is....
Dim varResult As Variant
'strWhere = "DrawingNum = " & Me.DrawingNum
Me.DrawingNum.SetFocus
varResult = DLookup("DrawingNum", "tbl_DrawingsAndData", _
"DrawingNum = '" &
Me.DrawingNum & "'")
If Not IsNull(varResult) Then
strMsg = "Drawing " & varResult & " Already Exists."
End If
I have been on this problem for two days now and for the life of me can't
figure out what is going on. I am not that dumb and everyone says to use the
DLookup to check for the duplicates so I am thinking maybe you can't for
Primary Keys.