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 / General 2 / April 2008

Tip: Looking for answers? Try searching our database.

Access 2002 SP3 "Object library feature not supported"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave370 - 19 Apr 2008 00:50 GMT
Hi,
I have just come across a problem that Microsoft Access 2002 SP3 appears to
have yet the original (No Service Packs) doesn't.

The problem occurs with some Visual Basic code that I wrote a long time ago
and yet I have never had this problem before. What the code is supposed to do
is if a tick box on a form is checked, a sub-form in that form is suppose to
not allow Additions Deletions and Edits to the records. If unchecked,
Additions, Deletions and Edits are allowed. The code is run when the form
opens and whenever the tick box is ticked or unticked (AfterUpdate).

The error message I receive is:
Compile Error:
Object library feature not supported

What's really strange though is that the code run when opening the form
works fine but AfterUpdate doesn't even though they're identical. I have
looked at the enabled references on both machines (One has SP3 one doesn't)
and they are identical. Here is the code:

Private Sub Form_Open(Cancel As Integer)
Dim ItemString As Form
Set ItemString = Me![Invoice Item].Form
If Invoiced = True Then
ItemString.AllowAdditions = False
ItemString.AllowDeletions = False
ItemString.AllowEdits = False
Else:
ItemString.AllowAdditions = True
ItemString.AllowDeletions = True
ItemString.AllowEdits = True
End If
End Sub

Private Sub invoiced_check_AfterUpdate()
Dim ItemString As Form
Set ItemString = Me![Invoice Item].Form
If Invoiced = True Then
ItemString.AllowAdditions = False
ItemString.AllowDeletions = False
ItemString.AllowEdits = False
Else:
ItemString.AllowAdditions = True
ItemString.AllowDeletions = True
ItemString.AllowEdits = True
End If
End Sub

Signature

Dave

Clif McIrvin - 19 Apr 2008 01:05 GMT
Dave -- do a search in this group (or .forms) on SP3 Hotfix ... I don't
recall particulars, but there has been discussion (2003 SP3)

MS Update link should also get you to the hotfix.
--
Clif
Access Learner

> Hi,
> I have just come across a problem that Microsoft Access 2002 SP3 appears
[quoted text clipped - 48 lines]
> End If
> End Sub
Tom Wickerath - 19 Apr 2008 10:14 GMT
Hi Dave,

Here is a link for the SP3 hotfix, just in case this happens to be the
needed patch:

   http://support.microsoft.com/kb/945674

Just out of curiousity, have you tried to compile the code?
    Debug | Compile ProjectName    while in the VBA Editor.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

Dave -- do a search in this group (or .forms) on SP3 Hotfix ... I don't
recall particulars, but there has been discussion (2003 SP3)

MS Update link should also get you to the hotfix.
--
Clif
Access Learner
__________________________________________

"Dave370" wrote:

Hi,
I have just come across a problem that Microsoft Access 2002 SP3 appears to
have yet the original (No Service Packs) doesn't.

The problem occurs with some Visual Basic code that I wrote a long time ago
and yet I have never had this problem before. What the code is supposed to do
is if a tick box on a form is checked, a sub-form in that form is suppose to
not allow Additions Deletions and Edits to the records. If unchecked,
Additions, Deletions and Edits are allowed. The code is run when the form
opens and whenever the tick box is ticked or unticked (AfterUpdate).

The error message I receive is:
Compile Error:
Object library feature not supported

What's really strange though is that the code run when opening the form
works fine but AfterUpdate doesn't even though they're identical. I have
looked at the enabled references on both machines (One has SP3 one doesn't)
and they are identical. Here is the code:

Private Sub Form_Open(Cancel As Integer)
Dim ItemString As Form
Set ItemString = Me![Invoice Item].Form
If Invoiced = True Then
ItemString.AllowAdditions = False
ItemString.AllowDeletions = False
ItemString.AllowEdits = False
Else:
ItemString.AllowAdditions = True
ItemString.AllowDeletions = True
ItemString.AllowEdits = True
End If
End Sub

Private Sub invoiced_check_AfterUpdate()
Dim ItemString As Form
Set ItemString = Me![Invoice Item].Form
If Invoiced = True Then
ItemString.AllowAdditions = False
ItemString.AllowDeletions = False
ItemString.AllowEdits = False
Else:
ItemString.AllowAdditions = True
ItemString.AllowDeletions = True
ItemString.AllowEdits = True
End If
End Sub

Signature

Dave

Dave370 - 21 Apr 2008 03:04 GMT
Hi Tom,
Sorry about the long reply. That hotfix appears to be for Office 2003 and I
have Office XP. I'm pretty sure there are a few differences between the
Microsoft Access provided in Office 2003 and Office XP (Although they both
use the same file format). Also if I try compiling by going Debug | Compile I
get the same error message. One thing I didn't mention in my last post though
was that it highlights "Invoiceitems =" from the line "Set Invoiceitems =
Me![Invoice Item].Form".
Signature

Dave

> Hi Dave,
>
[quoted text clipped - 71 lines]
> End If
> End Sub
Tom Wickerath - 21 Apr 2008 05:42 GMT
Hi Dave,

You're right....I got my verisions mixed up. So, the SP-3 hotfix does not
apply in your case. Try this version. It calls the SetFormEdits procedure
from Form_Current and from invoiced_check_AfterUpdate:

Option Compare Database
Option Explicit

Private Sub Form_Current()
   SetFormEdits
End Sub

Private Sub invoiced_check_AfterUpdate()
   SetFormEdits
End Sub

Private Sub SetFormEdits()
On Error GoTo ProcError

   With Me
       .AllowEdits = Not Me.invoiced_check
       .AllowDeletions = .AllowEdits
       .AllowAdditions = .AllowEdits
   End With

ExitProc:
   Exit Sub
ProcError:
   MsgBox "Error " & Err.Number & ": " & Err.Description, _
         vbCritical, "Error in procedure SetFormEdits..."
   Resume ExitProc
End Sub

Of course, this doesn't allow one to uncheck the Invoiced_Check checkbox,
since the form is already locked down at that point.

Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

> Hi Tom,
> Sorry about the long reply. That hotfix appears to be for Office 2003 and I
[quoted text clipped - 4 lines]
> was that it highlights "Invoiceitems =" from the line "Set Invoiceitems =
> Me![Invoice Item].Form".
Dave370 - 21 Apr 2008 06:13 GMT
Thanks Tom, but that method is a bit of a compromise for me. I would still
prefer to able to check and uncheck the Check Box. My current method for
doing this is for the Check Box to be located on the Main Form and the
records I want to lock to be in a Sub Form.

I'm starting to wonder if Office XP SP3 is worth the effort. What I will do
now is reinstall Office XP without any Service Packs on the machine which
currently has SP3 and see if this solves the problem (I'm not entirely sure
if SP3 is the problem but I'm pretty sure it is since that's the only
difference I could find).
Signature

Dave

> Hi Dave,
>
[quoted text clipped - 47 lines]
> > was that it highlights "Invoiceitems =" from the line "Set Invoiceitems =
> > Me![Invoice Item].Form".
Tom Wickerath - 21 Apr 2008 06:22 GMT
Hi Dave,

Oh, sorry, I didn't know you were using a check box on a main form to lock a
subform. After reviewing your initial post, I see that you did mention this.
I honestly don't think this is related to XP SP-3, but I don't know that for
sure. Give me a few minutes to check out some revised code, before you do the
re-install. I'll post back shortly.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

> Thanks Tom, but that method is a bit of a compromise for me. I would still
> prefer to able to check and uncheck the Check Box. My current method for
[quoted text clipped - 6 lines]
> if SP3 is the problem but I'm pretty sure it is since that's the only
> difference I could find).
Tom Wickerath - 21 Apr 2008 06:51 GMT
Sorry for the delay. Got interrupted with a phone call....

Make the following change to the SetFormEdits procedure, where "Invoice
Item" is the name of the subform control. This may or may not be the same
name as the subform itself. It's important that you use the name of the
control that holds the subform. Leave the Form_Current and
Invoice_Check_AfterUpdate procedures as is. All code goes in your main form.

Private Sub SetFormEdits()
On Error GoTo ProcError

Dim ItemString As Form
Set ItemString = Me![Invoice Item].Form

   With ItemString
       .AllowEdits = Not Me.invoiced_check
       .AllowDeletions = .AllowEdits
       .AllowAdditions = .AllowEdits
   End With

ExitProc:
   Exit Sub
ProcError:
   MsgBox "Error " & Err.Number & ": " & Err.Description, _
         vbCritical, "Error in procedure SetFormEdits..."
   Resume ExitProc
End Sub

Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

> Hi Dave,
>
[quoted text clipped - 21 lines]
> > if SP3 is the problem but I'm pretty sure it is since that's the only
> > difference I could find).
 
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.