i got this code from this site and i guess i'm not too bright.
If Me.NewRecord Then
If Not IsNull(DLookup("PrimaryID", "TableName", "[PrimaryID] = " & Me.PrimaryID)) Then
MsgBox "This ID already exists"
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[PrimaryID] = " & Me![PrimaryID]
Me.Undo
Me.Bookmark = rs.Bookmark
End If
End If
my text box name on my form is partnbr and my field name in my table tblpartnbr is called partnbr. I have substiuted these names into this code and i just get a compile error. i would really appreciate some help please.
[This message has been edited by cliff7376 (edited 03-19-2002).]
If Me.NewRecord Then
If Not IsNull(DLookup("PrimaryID", "TableName", "[PrimaryID] = " & Me.PrimaryID)) Then
MsgBox "This ID already exists"
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[PrimaryID] = " & Me![PrimaryID]
Me.Undo
Me.Bookmark = rs.Bookmark
End If
End If
my text box name on my form is partnbr and my field name in my table tblpartnbr is called partnbr. I have substiuted these names into this code and i just get a compile error. i would really appreciate some help please.
[This message has been edited by cliff7376 (edited 03-19-2002).]