Error when using Setvalue command

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I have a machine containing Access 2000 on Win 98 (both
chinese)
and another machine containing Access 2003 (Eng) on WinXP
(Chinese)

On my Access 2000 machine,
I create a database file and put a command button on a
form.
On the button's on focus event, I put a setvalue macro to
change its forecolor to red. I use the builder wizard in
setting the action arguments. When I run the form and
when the button got focus, it returns the following error
mssg:-

QUOTE
The object doesn't contain the Automation Object "Form"

You tried to run a Visual Basic procedure to set a
property or method for an object. However, the component
doesn't make the property or method available for
Automation operation.

Check the component's documentation for information on the
properties and methods it makes available for Automation
operation.
UNQUOTE.

I use my Access 2003 machine to open the same database
file, when the button got focus, the same error mssg
appears.

What is interesting is that,
When I use Access 2003 machine to create a database file
and use the same procedure to change button forecolor by
the same setvalue macro, it work.

Then I use Access 2000 machine to open that file, the
button do change color when get on focus.

The above tells that
If the setvalue macro is created on Access 2003, it work
both in Access 2000 and Access 2003.
If the setvalue macro is created on Access 2000, it cannot
work in both Access 2000 and Access 2003, where it returns
me the above error mssg.
and it appears that the "setvalue" command in my Access
2000 is not functioning.

It will be great if someone can tell me how to "activate"
thes setvalue function in my Access 2000.
 
Simon,

Can you please tell us what is the Item and Expression arguments for the
SetValue action in your macro?
 
Dear Steve

Thank you for your reply.

I have just read your reply email for Xavier on similar
situation, and have found your suggestion therein solved
my problem, i.e., in the item field, just remove
the "[Form]![Form name]" and leave only the control name,
which is [Command1].[Forecolor] and Argument set as "255"
(color red). When the macro is triggered, the words on
the button turns red, and no more error mssg.

Before I had read your solution, I tried the same thing on
on Access 2003, and in same situation, for the item field
I put the full path : [Form]![Form name]!
[Command1].forecolor, it works without returning me any
error mssg. And when I run that file on my Access 2000,
it also works. This makes me feel that it is something to
do with my Access 2000 setting.

So do you have any idea about the above experience.



Best regards
Simon Wong
 
Back
Top