Question : How do I check for a duplicate record?

Hello,  I am a newbie at Access, and am creating a database simply to learn how. I created a form to input data into my table. The form consist of seperate text boxes that when the user hits the "add" button that I created it assigns the values in the text boxes to the appropriate fields in the table.  My question is, I am now wanting to have the form check the table to see if a record already exist before adding the information as a new duplicate record.   I may be way off but here is what I have jotted down so far.

Txt_Title = the name of my text box on my form
tbl_DvdInfo = name of my table
Title = Name of field in my Table

Again...I am totally new at this. Thanks
Code Snippet:
1:
2:
3:
If Me.Txt_Title.Value = Dlookup(Title, tbl_DvdInfo) Then
Msgbox "DVD Title already Exsists"'vbokonly
Else: End If

Answer : How do I check for a duplicate record?

OKay.  I figured it out.  Works like a charm....so far.  Here is the code that i was looking for.
1:
2:
Dim Same As String
Same = DLookup("Title", "[tbl_DvdInfo]", "Title = Txt_Title")
Random Solutions  
 
programming4us programming4us