SetProperty Action in Macro

S

Sarah

Trying to make a text box field visible if one condition exists and not
visible at all other times. Have the GotoControl working and goes to the text
box but when I try using the SetProperty visible to true getting the error
message that the control does not exist. Not sure why it recogonizes
GoToControl action but not the SetProperty action. Using Access 2007. Any
help would be appreciated.
 
S

Steve Schapel

Sarah,

I am not familiar with a SetProperty action, but I don't think it is
relevant to what you are trying to do. However, I think the SetValue
action may be applicable. However, I would not expect it is a good idea
to set the focus to the control in question, because you would not be
able to set its Visible property to No if it has the focus.
 
S

Sarah

Steve

I used the GoToCommand to make that sure that the textbox is active on that
form - and it verified that it did. I dont really need it. From 2003 Access
to 2007 Access in Macros they took out SetValue and replaced it with
SetProperty. When I experimented with the same code in 2003 using SetValue it
worked fine. When I tried the SetProperty in 2007 I get the "Cant find
Control". Not sure if it is a bug 2007 Access.

Thanks for replying
Sarah
 
S

Steve Schapel

Sarah,
... From 2003 Access
to 2007 Access in Macros they took out SetValue and replaced it with
SetProperty.

I am not sure where you got this information, but it is not correct.
The SetProperty action is not a replacement for SetValue. I suggest you
use the SetValue action in Access 2007 for your purpose here.
 
S

Sarah

Steve

This is my last post about this. Iam not a developer so you might have more
options then I do. When I click on actions in Macros SetValue is not an
option only SetProperty. When I went into help about SetValue in macros there
was this note:

NOTE This action will not be allowed if the database is not trusted. For
more information about enabling macros, see the links in the See Also section
of this article.

I tried enable all macros in the Trust Center. This still would not let me
have access to SetValue.

Evidently I cannot run it or write it.

Sarah
 
S

Steve Schapel

Sarah,

It sounds like you need to click the 'Show All Actions' button under
Macro Design Tools on the Ribbon.
 
G

Gil

I came across this post because I had a similar problem of not seeing the
SetValue macro in the list. What I'm seeing is that since I have my database
set for 2003 compatibility the "Show All Actions" button is greyed out and
therefore I cannot get the SetValue option into the list. It appears that
SetValue has been around before Access 2007 so I don't understand this
restriction.

If I save my database in Access 2007 format I am able to check the "Show All
Actions" button which does provide the SetValue macro but we have very few
users with the new version of Access so it looks like I'm stuck with using
the Code builder.

Is this an oversight?

Gil Jones
 

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