Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2007

Tip: Looking for answers? Try searching our database.

Error with RecordSet Coding

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
iholder - 13 Mar 2007 16:24 GMT
I am getting an an error message with the code below.
"Compile error - Method or data member not found.
Error line  ".Edit"

I am using DAO library 3.6.

'OPEN EMPLOYEE LOGIN TABLE
    Dim dbs As DAO.Database
   Dim rstEmployees As Recordset
   Set dbs = OpenDatabase("PaperInventory.mdb")
   Set rstEmployees = dbs.OpenRecordset("tblLogInTracking")

   With rstEmployees
       .Edit    '(Error Message Here)
       !LogOutTime = Time
   End With
    rstEmployees.Close
   Set rstEmployees = Nothing
  ' Set dbs = Nothing
   DoCmd.Close

Help Please
Thank You
Ileana
Stefan Hoffmann - 13 Mar 2007 16:31 GMT
hi Ileana,

> I am getting an an error message with the code below.
> "Compile error - Method or data member not found.
> Error line  ".Edit"
> I am using DAO library 3.6.
There is .Edit in DAO.Recordset. You may use the object browser (F2) to
verify this. Just change your values.

mfG
--> stefan <--
iholder - 13 Mar 2007 16:51 GMT
I am confessed. The object brower show  ".dbEditAdd"  which also give an
error message.  And what values am I changing.

thank you

> hi Ileana,
>
[quoted text clipped - 7 lines]
> mfG
> --> stefan <--
Stefan Hoffmann - 13 Mar 2007 16:57 GMT
hi Ileana,

> I am confessed. The object brower show  ".dbEditAdd"  which also give an
> error message.  And what values am I changing.
Using the object browser, you need to look after Recordset in the DAO
library. Which will lead us to:

Ooops, my fault, didn't read you your post carefully enough.

> I am using DAO library 3.6.
>
>     Dim dbs As DAO.Database
>     Dim rstEmployees As Recordset
You need to declare it as

  Dim rstEmployees As DAO.Recordset

otherwise the library order in the references will decide of which kind
it will be. ADO is normally the default.

mfG
--> stefan <--
iholder - 13 Mar 2007 17:51 GMT
I modified the code as stated. But I am still getting a different error
message. The new error message is;

"object variable or with Block variable no set."

'OPEN EMPLOYEE LOGIN TABLE
   Dim dbs As DAO.Database
   Dim rstEmployees As DAO.Recordset
   Set rstEmployees =   dbs.OpenRecordset("tblLogInTracking")

   With rstEmployees
       .Edit
       !LogOutTime = Time
   End With
   
   rstEmployees.Close
   Set rstEmployees = Nothing
  ' Set dbs = Nothing

   DoCmd.Close

> hi Ileana,
>
[quoted text clipped - 18 lines]
> mfG
> --> stefan <--
Stefan Hoffmann - 14 Mar 2007 10:54 GMT
hi Ileana,

> 'OPEN EMPLOYEE LOGIN TABLE
>     Dim dbs As DAO.Database
>     Dim rstEmployees As DAO.Recordset
>     Set rstEmployees =   dbs.OpenRecordset("tblLogInTracking")
Before using dbs you need to assign a object to it:

  Set dbs = CurrentDb

is missing.

mfG
--> stefan <--

--
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.