You need to use DLookup. This built-in function goes through all the records in your table and checks the specified field. It looks for whatever you put in the criteria (in this case table field must equal the form control value). If it finds the search material, then it does whatever you tell it to do.
'--------------------------------------------
If (Not IsNull(DLookup("[TableField]", "tblYourTable", "[TableField] ='" & Me!FormControl & "'"))) Then
msgbox "This already exists."
end if
'--------------------------------------------
This is the function:
dlookup(Expr As String, Domain As String, [Criteria])
expr = what table field to search. This can be any field on the table.
Domain = which table/query to search
Criteria = What must be true. In my case, the table field must equal my form control value.
I hope this is helpful.
-Mark
[This message has been edited by Accessable (edited 02-21-2002).]