Access 2002 SP3 "Object library feature not supported"

D

Dave370

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
 
C

Clif McIrvin

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.
 
T

Tom Wickerath

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
__________________________________________

:

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
 
D

Dave370

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".
--
Dave


Tom Wickerath said:
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
__________________________________________

:

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
 
T

Tom Wickerath

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
__________________________________________
 
D

Dave370

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).
--
Dave


Tom Wickerath said:
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
__________________________________________

Dave370 said:
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".
 
T

Tom Wickerath

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
__________________________________________
 
T

Tom Wickerath

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
__________________________________________
 

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