Error with RecordSet Coding

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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 <--
 
I am confessed. The object brower show ".dbEditAdd" which also give an
error message. And what values am I changing.

thank you
 
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 <--
 
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,
'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 <--

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top