While in the VB Editor, select Tools | References from the menu. If
Microsoft DAO 3.6 Object Library isn't one of the selected references,
scroll through the list until you find it and select it. If it is one of the
selected references, do any of the other selected references have MISSING:
in front of them?
Oh, and change your declaration from
Dim rstEmployees As Recordset
to
Dim rstEmployees As DAO.Recordset
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Ivano Venturi" <(E-Mail Removed)> wrote in message
news:BD719AC0-E5BF-41A8-BE92-(E-Mail Removed)...
> In the MS Access 2003 User Guide is reported the following example about
> AddNew method:
>
> Dim dbsNorthwind As Database
> Dim rstEmployees As Recordset
>
> Set dbsNorthwind = OpenDatabase("Northwind.mdb")
> Set rstEmployees = dbsNorthwind.OpenRecordset("Employees",
> dbOpenDynaset)
>
> As my database name is RegSIP_app.mdb, RegSIP_dat.mdb is the one where are
> stored all the data tables and Tab_PreAmb is the name of the table in
> which I
> have to add a new record when user clicks a button on a form stored in
> RegSIP_app.mdb, I tried to write something like this:
>
> Dim dbsRegSIP As Database
> Dim rstPreAmb As Recordset
>
> Set dbsRegSIP = OpenDatabase("g:\RegSIP\RegSIP_dat.mdb")
> Set rstPreAmb = dbsRegSIP.OpenRecordset("Tab_PreAmb", dbOpenDynaset)
>
> I have MS Access 2003 SP3 and it does not work at all ! :-S I mean ... it
> gives me a compilation error saying that the user defined type is not
> defined
> !?! Can someone help me to find where is my mistake ?!? Thank you very
> much
> in advance !
>
> Greetings from Modena,
> Emilia-Romagna - Italy.
>