You need to check references and make sure that reference to "Microsoft DAO 3.6 Object Library" is checked.
To do that:
1. Open Code Window;
2. Go menu bar Tools | References.
HTH, Igor
>Hi Igor, Thanks for the help but the first line of code:
>"Dim R As DAO.Recordset" is generating the following error:
>
>"Compile Error: User Defined Type Not Defined"
>
>
>
>
>Hi Michael,
>
>Are you sure that field CATALOG is a string datatype? If it is NUMERIC it would give you an error.
>Personally I prefer code like this:
>
>
>Private Sub Command32_Click()
>
>Dim R As DAO.Recordset
>Dim SQLText as String
>
>SQLText = "Select * From Product Where Catalog = 'CAT3';"
>Set R = CurrentDb.OpenRecordset(SQLText,dbOpenDynaset) ' consider dbOpenSnapshot
>If not R.BOF() Then
> MsgBox "Record exists"
>Else
> MsgBox "Record not found"
>End If
>R.Close
>Set R=Nothing
>
>End Sub
Igor Gelin
Database Developer