I am getting a compile error... Can someone pls tell me what I am doing
wrong...
Private Sub Command5_Click()
Dim db As Database <<<----debugger highlights this yellow
Dim rctMakeAdd As Recordset
'*** Create a pointer to the database and a pointer to the table ***
Set db = CurrentDb()
Set rctMakeAdd = db.OpenRecordset("tblMake", dbOpenTable)
' ****Validate the Date field***
If IsNull(make) Or Len(make) = 0 Then
MsgBox "Please Enter a Make"
make.SetFocus
rctMakeAdd.Close
db.Close
Exit Sub
End If
"Database" is an object which is declared in the Data Access Objects (DAO)
object library.
By default, Access 2000 gives new databases a reference to the ActiveX Data
Objects (ADO) library, and omits a reference to the DAO library. (They have
reversed this change in later versions, thank goodness!)
From the code window, go to Tools->References. Find and check:
Microsoft DAO 3.x Object Library
(where "3.x" is the highest version you can see - probably 3.6)
If you are NOT using any ADO code anywhere in your database, you can uncheck
the reference to:
Microsoft ActiveX Data Objects 2.x Library
It's a good idea to include an explicit "DAO." in your declarations, to
make it clear which object model you are using. For example:
Dim db as DAO.Database
Dim rs as DAO.Recordset
This is not so essential for "Database", but both libraries have a
"Recordset", so the ambiguity can become a problem.

Signature
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
>I am getting a compile error... Can someone pls tell me what I am doing
> wrong...
[quoted text clipped - 15 lines]
> Exit Sub
> End If
RIP - 09 May 2005 06:05 GMT
That did it!!!! Thank you very much Graham!!!
Rgds.,
Walter
> "Database" is an object which is declared in the Data Access Objects (DAO)
> object library.
[quoted text clipped - 38 lines]
> > Exit Sub
> > End If