method or data member not found

D

Dwight

We just upgraded to MS Access 2007. I converted the database to 2007. Now
when I try to open the main form I get an erro that the method or data member
not found.

The error is happening on the .edit line of the code below:

Dim rstCompareDate As Recordset
Dim dbsCompareDate As Database
Dim dtCompareDate As Date
DoCmd.OpenForm "frmKeepOpen", acNormal, , , , acHidden
Set dbsCompareDate = CurrentDb
Set rstCompareDate = dbsCompareDate.OpenRecordset("CompareDate",
dbOpenDynaset)
'***************************************************************************
'********Check system date to determine if it is a new day.*****************
'********If it is a new day then the pending actions are updated************
'***************************************************************************
With rstCompareDate
dtCompareDate = !CompareDate
If dtCompareDate < date Then
UpdatePendingActions
UpdatePendingPromotions
End If
.Edit
!CompareDate = date
.Update

End With
....
End Sub

Does anyone have an idea or fix to this problem?

Thanks in advance!

Dwight
 
D

Dirk Goldgar

Dwight said:
We just upgraded to MS Access 2007. I converted the database to 2007.
Now
when I try to open the main form I get an erro that the method or data
member
not found.

The error is happening on the .edit line of the code below:

Dim rstCompareDate As Recordset
Dim dbsCompareDate As Database
Dim dtCompareDate As Date
DoCmd.OpenForm "frmKeepOpen", acNormal, , , , acHidden
Set dbsCompareDate = CurrentDb
Set rstCompareDate = dbsCompareDate.OpenRecordset("CompareDate",
dbOpenDynaset)
'***************************************************************************
'********Check system date to determine if it is a new
day.*****************
'********If it is a new day then the pending actions are
updated************
'***************************************************************************
With rstCompareDate
dtCompareDate = !CompareDate
If dtCompareDate < date Then
UpdatePendingActions
UpdatePendingPromotions
End If
.Edit
!CompareDate = date
.Update

End With
...
End Sub

Does anyone have an idea or fix to this problem?


What happens if you change the declaration of the recordset object to:

Dim rstCompareDate As DAO.Recordset

?
 
D

Dwight

That took care of that one, but now it is doing to same thing everywhere that
type of method is being used. I started to step through the code and put the
DAO. in front of the recordset lines then I got a "Type Mismatch" error on
this line:

Set rstCheckPending = dbsCompareDate.OpenRecordset("qryUpdateNewAssignment",
dbOpenDynaset)

Is this a related error?

How do I fix it?

Why does my code work in 2003 but not in 2007?

I checked the references and noticed that the Microsoft DAO 3.6 Object
Library was not selected. When I tried to select it I got the following
message:

"Name conflicts with existing module, project, or object library"

Please help!!!

Thanks in advance!

Dwight
 
D

Dirk Goldgar

Dwight said:
That took care of that one, but now it is doing to same thing everywhere
that
type of method is being used. I started to step through the code and put
the
DAO. in front of the recordset lines then I got a "Type Mismatch" error on
this line:

Set rstCheckPending =
dbsCompareDate.OpenRecordset("qryUpdateNewAssignment",
dbOpenDynaset)

Is this a related error?

How do I fix it?

Why does my code work in 2003 but not in 2007?

I checked the references and noticed that the Microsoft DAO 3.6 Object
Library was not selected. When I tried to select it I got the following
message:

"Name conflicts with existing module, project, or object library"


Instead of that library, for Access 2007 check the reference named
"Microsoft Office 12.0 Access database engine Object Library". This library
replaces the original DAO library for A2007.

If you happen to have a reference set for the ADO Library (MIcrosoft ActiveX
Data Objects 2.x Library), and you aren't using it, uncheck it. Then you
won't have to disambiguate your Recordset declarations.
 
D

Dwight

Thanks you!
The main form is now working, however, the Start-up form is getting an error:

Error - The Operating System is presently not configured to run this
application.

We are currently running Windows XP Professional 5.1

The error is occurring on the following line of code:

DoCmd.Quit acQuitSaveAll

Do you know how to fix this problem?

Dwight
 
D

Dirk Goldgar

Dwight said:
Thanks you!
The main form is now working, however, the Start-up form is getting an
error:

Error - The Operating System is presently not configured to run this
application.

We are currently running Windows XP Professional 5.1

The error is occurring on the following line of code:

DoCmd.Quit acQuitSaveAll

Do you know how to fix this problem?


That's a new one on me! Googling tells me it's an OS error, but that it
could be caused by a faulty installation of Office. If you upgraded from
Access 2003 to 2007, did you ensure that you installed A2007 in a different
folder? You may need to repair your installation, or uninstall 2007 and
reinstall it in a different location. I don't really know; I'm just
guessing.
 

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

Top