Compile Error on .Last Modified

  • Thread starter Thread starter LisaB
  • Start date Start date
L

LisaB

I have imported the following code into my MS Access 2000 database and get a
compile error.
This code works in another database.
When trying to compile the .LastModified is highlighted when the error
message appears

also

I have simular code where the .Edit gets highlighted when the error message
appears



Microsoft Visual Basic - Compile Error - Method or data member not
found
----------------------------------
Set TheDB = CurrentDb
Set SourceRS = TheDB.OpenRecordset("tblOpened", dbOpenDynaset)


With SourceRS
.Edit
!Opened = !Opened + 1
.Update
.Bookmark = .LastModified
End With


SourceRS.Close
 
The problem is probably with your references. Go into
Tools-> references, and add one to the DAO 3.6 object
library. Then, everywhere you see

Dim rs As Recordset

You'll have to:

Dim rs As ADODB.Recordset
Or
Dim rs As DAO.Recordset.


Otherwise, just change the Dim statement in your existing
code to:

Dim SourceRS As Object


Chris Nebinger
 
LisaB said:
I have imported the following code into my MS Access 2000 database
and get a compile error.
This code works in another database.
When trying to compile the .LastModified is highlighted when the error
message appears

also

I have simular code where the .Edit gets highlighted when the error
message appears



Microsoft Visual Basic - Compile Error - Method or data member
not found
----------------------------------
Set TheDB = CurrentDb
Set SourceRS = TheDB.OpenRecordset("tblOpened", dbOpenDynaset)


With SourceRS
.Edit
!Opened = !Opened + 1
.Update
.Bookmark = .LastModified
End With


SourceRS.Close

See my answer to your subsequent question on the type mismatch error.
 
Back
Top