Office XP update broke app

  • Thread starter Thread starter Mick Ruthven
  • Start date Start date
M

Mick Ruthven

Yesterday morning I ran multiple Microsoft updates to Office XP. A bit later
I tried to run an Access 2000 app that's been running for years and got an
error. The error is "Object library feature not supported". The code is in
the Got Focus event of a Combo Box on a form. The code is pasted below. The
"[Form]" in Case 1 is highlighted.
-----------------------------------------
Private Sub Select_Combo_GotFocus()

gloFindRec = False

If gloLastAction = "PEOPLE TYPE OPTION GROUP" Then
' Set up new query for combo box
Select Case [Select Type Option Group]
Case 1 ' People - Last Name
dummy = SetForLastName([Form])
Case 2 ' People - First Name
dummy = SetForFirstName([Form])
Case 3 ' Company
dummy = SetForCompany([Form])
End Select
End If

End Sub
 
What is Form?

If it's the name of a control, I think you were just lucky that it
previously worked, as Form is a reserved word.

It it's supposed to be a reference to the active form, use Me instead.
 
[Form] was a reference to the active form. I just tried [Me] instead and it
gave the same error message.

Douglas J. Steele said:
What is Form?

If it's the name of a control, I think you were just lucky that it
previously worked, as Form is a reserved word.

It it's supposed to be a reference to the active form, use Me instead.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)


Mick Ruthven said:
Yesterday morning I ran multiple Microsoft updates to Office XP. A bit later
I tried to run an Access 2000 app that's been running for years and got an
error. The error is "Object library feature not supported". The code is in
the Got Focus event of a Combo Box on a form. The code is pasted below. The
"[Form]" in Case 1 is highlighted.
-----------------------------------------
Private Sub Select_Combo_GotFocus()

gloFindRec = False

If gloLastAction = "PEOPLE TYPE OPTION GROUP" Then
' Set up new query for combo box
Select Case [Select Type Option Group]
Case 1 ' People - Last Name
dummy = SetForLastName([Form])
Case 2 ' People - First Name
dummy = SetForFirstName([Form])
Case 3 ' Company
dummy = SetForCompany([Form])
End Select
End If

End Sub
-----------------------------------------

Thanks,

Mick Ruthven
 
One more thing. This Access app was developed and ran for years on Access
2000 on Win 2000, then was moved to a Win XP system with Access 2002 and ran
fine there until the Office XP update yesterday.
 
Use Me, without the square brackets.

As I said, what you had was actually not syntactically correct, so if it was
working, it's just because Access was being "forgiving". It's possible that
something in whatever update you applied made Access insist on proper
syntax.

On the other hand, it's possible that it's simply a misleading message, and
that the actual problem is a broken reference. This is a common problem with
Access when updates are installed.

With any code module open, select Tools | References from the menu bar.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)


Mick Ruthven said:
[Form] was a reference to the active form. I just tried [Me] instead and it
gave the same error message.

Douglas J. Steele said:
What is Form?

If it's the name of a control, I think you were just lucky that it
previously worked, as Form is a reserved word.

It it's supposed to be a reference to the active form, use Me instead.
got
is
in
the Got Focus event of a Combo Box on a form. The code is pasted
below.
The
"[Form]" in Case 1 is highlighted.
-----------------------------------------
Private Sub Select_Combo_GotFocus()

gloFindRec = False

If gloLastAction = "PEOPLE TYPE OPTION GROUP" Then
' Set up new query for combo box
Select Case [Select Type Option Group]
Case 1 ' People - Last Name
dummy = SetForLastName([Form])
Case 2 ' People - First Name
dummy = SetForFirstName([Form])
Case 3 ' Company
dummy = SetForCompany([Form])
End Select
End If

End Sub
-----------------------------------------

Thanks,

Mick Ruthven
 
Under Tools | References, there is a huge list. No entries have "Missing" in
from on them.
If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added.

That worked! And now both "[Form]" and "Me" work. What was that
selecting/unselecting all about?

Douglas J. Steele said:
Use Me, without the square brackets.

As I said, what you had was actually not syntactically correct, so if it was
working, it's just because Access was being "forgiving". It's possible that
something in whatever update you applied made Access insist on proper
syntax.

On the other hand, it's possible that it's simply a misleading message, and
that the actual problem is a broken reference. This is a common problem with
Access when updates are installed.

With any code module open, select Tools | References from the menu bar.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)


Mick Ruthven said:
[Form] was a reference to the active form. I just tried [Me] instead and it
gave the same error message.

Douglas J. Steele said:
What is Form?

If it's the name of a control, I think you were just lucky that it
previously worked, as Form is a reserved word.

It it's supposed to be a reference to the active form, use Me instead.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)


Yesterday morning I ran multiple Microsoft updates to Office XP. A bit
later
I tried to run an Access 2000 app that's been running for years and
got
an
error. The error is "Object library feature not supported". The code
is
in
the Got Focus event of a Combo Box on a form. The code is pasted below.
The
"[Form]" in Case 1 is highlighted.
-----------------------------------------
Private Sub Select_Combo_GotFocus()

gloFindRec = False

If gloLastAction = "PEOPLE TYPE OPTION GROUP" Then
' Set up new query for combo box
Select Case [Select Type Option Group]
Case 1 ' People - Last Name
dummy = SetForLastName([Form])
Case 2 ' People - First Name
dummy = SetForFirstName([Form])
Case 3 ' Company
dummy = SetForCompany([Form])
End Select
End If

End Sub
-----------------------------------------

Thanks,

Mick Ruthven
 
It forces Access to update its internal pointers.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)


Mick Ruthven said:
Under Tools | References, there is a huge list. No entries have "Missing" in
from on them.
If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just
added.

That worked! And now both "[Form]" and "Me" work. What was that
selecting/unselecting all about?
 
Thanks so much for the help!

Douglas J. Steele said:
It forces Access to update its internal pointers.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)


Mick Ruthven said:
Under Tools | References, there is a huge list. No entries have
"Missing"
in
from on them.
If none have "MISSING:", select an additional reference at random,
back
out
of the dialog, then go back in and unselect the reference you just
added.

That worked! And now both "[Form]" and "Me" work. What was that
selecting/unselecting all about?
 
Form is a reserved word, but using it is not just luck.

[form], (Access 2.0), predates "Me", (Access 95/97).
"Form" is a property of any form, as Me.Form or Me.[form].
In fact, you can think of Form as the default property of Me (Me has a .Form
property, but Form has no .Me property).
Of course since [Form] is older than 'Me', it may have some odd
characteristics other than as an object property.


Importantly, [form], [report] and [control] work in control source
properties (as will other form/report properties), where neither "Me" nor
"ActiveForm" will work.


From the help description, it's not clear which form [form] would refer to
in a situation where Me is different from Screen.ActiveForm

(david)


Douglas J. Steele said:
What is Form?

If it's the name of a control, I think you were just lucky that it
previously worked, as Form is a reserved word.

It it's supposed to be a reference to the active form, use Me instead.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)


Mick Ruthven said:
Yesterday morning I ran multiple Microsoft updates to Office XP. A bit later
I tried to run an Access 2000 app that's been running for years and got an
error. The error is "Object library feature not supported". The code is in
the Got Focus event of a Combo Box on a form. The code is pasted below. The
"[Form]" in Case 1 is highlighted.
-----------------------------------------
Private Sub Select_Combo_GotFocus()

gloFindRec = False

If gloLastAction = "PEOPLE TYPE OPTION GROUP" Then
' Set up new query for combo box
Select Case [Select Type Option Group]
Case 1 ' People - Last Name
dummy = SetForLastName([Form])
Case 2 ' People - First Name
dummy = SetForFirstName([Form])
Case 3 ' Company
dummy = SetForCompany([Form])
End Select
End If

End Sub
-----------------------------------------

Thanks,

Mick Ruthven
 
Back
Top