R
ryguy7272
I recently installed Office 2007 on my ThinkPad. I was using Office 2002 for
quite some timed and loved it. Not a huge fan of 2007 yet, but I’m getting
there. Now, I’ve got both office suites installed on my system (I use one at
a time).
I’ve encountered no problems with any apps, except for running Access 2002
VBA. Problems don’t occur with all of my files, but I’d say 90+% are
problematic. I’m guessing it has to do with the references under Tools >
References, but I can’t figure out what reference needs to be checked. I
have checked off the following:
Visual Basic for Applications
Microsoft Access 12.0 Object Library
OLE Automation
Microsoft Visual Basic for Applications Extensibility 5.3
Microsoft DAO 3.6 Object Library
That’s it for now.
I open a small database that searches for a person by last name. When I
open it in 2002, I get this error: ‘The expression On Click you entered as
the event property setting produced the following error: Object or class does
not support the set of events.’
If I open the file in 2007, then save as 2007, it works fine.
Here is the VBA (but I don’t think it matters; I’m pretty sure it really has
something to do with those references):
Option Compare Database
Option Explicit
Private Sub cboCompanyID_AfterUpdate()
Me!txtEmployer = Me!cboCompanyID.Column(1)
End Sub
Private Sub cmdPersonSearch_Click()
On Error Resume Next
Dim lngPersonID As Long
lngPersonID = GetPersonID
If lngPersonID <> 0 Then
Dim rs As Recordset
Dim db As Database
Dim criteria As String
Set db = CurrentDb()
Set rs = Me.RecordsetClone
criteria = "[PersonID] =" & lngPersonID
rs.FindFirst criteria
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
Else
MsgBox "Record Not Found"
End If
Me.Refresh
End If
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Exit Sub
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error Resume Next
Me!Updated = Now()
Me!User = CurrentUser()
Exit Sub
End Sub
Private Sub Form_Current()
Me.Caption = " " & Me![txtFirstName] & (" " + Me![txtMiddleName]) & " " &
Me![txtLastName]
End Sub
When Access 2002 loads, I see a reference to Microsoft Access 12.0 Object
Library. I think this should be Microsoft Access 10.0 Object Library, but
there is no option for that. Also, I see a reference for Microsoft Office
12.0 Object Library, but no reference for Microsoft Office 10.0 Object
Library. In both Word and excel 2002, I have a reference to Microsoft Office
10.0 Object Library. Any ideas as to what to do to make my older Access 2002
code work?
Thanks!
Ryan---
quite some timed and loved it. Not a huge fan of 2007 yet, but I’m getting
there. Now, I’ve got both office suites installed on my system (I use one at
a time).
I’ve encountered no problems with any apps, except for running Access 2002
VBA. Problems don’t occur with all of my files, but I’d say 90+% are
problematic. I’m guessing it has to do with the references under Tools >
References, but I can’t figure out what reference needs to be checked. I
have checked off the following:
Visual Basic for Applications
Microsoft Access 12.0 Object Library
OLE Automation
Microsoft Visual Basic for Applications Extensibility 5.3
Microsoft DAO 3.6 Object Library
That’s it for now.
I open a small database that searches for a person by last name. When I
open it in 2002, I get this error: ‘The expression On Click you entered as
the event property setting produced the following error: Object or class does
not support the set of events.’
If I open the file in 2007, then save as 2007, it works fine.
Here is the VBA (but I don’t think it matters; I’m pretty sure it really has
something to do with those references):
Option Compare Database
Option Explicit
Private Sub cboCompanyID_AfterUpdate()
Me!txtEmployer = Me!cboCompanyID.Column(1)
End Sub
Private Sub cmdPersonSearch_Click()
On Error Resume Next
Dim lngPersonID As Long
lngPersonID = GetPersonID
If lngPersonID <> 0 Then
Dim rs As Recordset
Dim db As Database
Dim criteria As String
Set db = CurrentDb()
Set rs = Me.RecordsetClone
criteria = "[PersonID] =" & lngPersonID
rs.FindFirst criteria
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
Else
MsgBox "Record Not Found"
End If
Me.Refresh
End If
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Exit Sub
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error Resume Next
Me!Updated = Now()
Me!User = CurrentUser()
Exit Sub
End Sub
Private Sub Form_Current()
Me.Caption = " " & Me![txtFirstName] & (" " + Me![txtMiddleName]) & " " &
Me![txtLastName]
End Sub
When Access 2002 loads, I see a reference to Microsoft Access 12.0 Object
Library. I think this should be Microsoft Access 10.0 Object Library, but
there is no option for that. Also, I see a reference for Microsoft Office
12.0 Object Library, but no reference for Microsoft Office 10.0 Object
Library. In both Word and excel 2002, I have a reference to Microsoft Office
10.0 Object Library. Any ideas as to what to do to make my older Access 2002
code work?
Thanks!
Ryan---