Hi Linda,
When I look at the original macro while in 2007, there is an
error at "setValue".
I found the following on pages 916-917, and in Table 18-1 "Macro Actions
That Are Not Trusted", in my copy of the book "Microsoft Office Access 2007
Inside Out", written by John L. Viescas and Jeff Conrad
(
http://www.amazon.com/dp/0735623252):
Bottom of page 916:
"Access 2007 recognizes 32 macro actions as potentially unsafe to run in a
database that is not trusted. Seven of the actions are not trusted only when
you select certain arguments. Table 18-1 lists the macro actions that Access
will run only when the database is trusted. The Comments column lists special
cases dependent on the arguments you choose or an alternative trusted method
you can use."
Page 917
Includes SetValue in the listing of Macro Actions That Are Not Trusted, with
the following comment: "Use the trusted SetProperty action instead of
SetValue to change the Enabled, Visible, Locked, Left, Top, Width, Height,
Fore Color, Back Color, or Caption properties of forms, reports or controls."
Also, on page 918, I see this: "Macro actions that are not trusted display
an exclamation mark in the left column of the macro design window."
It is very frustrating that something that worked and was so easy is now not
working because 2007.
I sympathize....I'm not using Access 2007 at this time.
The code is simple -while in one form on a record,
clicking the button runs onclick opens a different form with a drop down,
make or type in a selected record and afterupdate closes the form and takes
the selection and filters the original form (with the button) to that record.
I'm not sure I understand, but it sounds to me like you are applying a
filter on a form bound to a larger recordset than what you ultimately wish to
work with. You might consider an alternate approach, which involves an
unbound search form that allows a user to find the record they wish to work
on. In this way, you have much less network traffic for a multiuser Access
application, where the data is on a shared file server. I have some examples
posted:
Simplist example, with one multi-select list box:
http://www.accessmvp.com/TWickerath/downloads/elements.zip
A bit more advanced samples:
http://www.accessmvp.com/TWickerath/downloads/Chap08QBF.zip
An example that includes a Word document with a sample database:
http://www.seattleaccess.org/downloads.htm
See the download "Query By Form"
Tom Wickerath, February 12, 2008
These examples all involve VBA code, which may seem a bit daunting to you at
first, but will definately pay dividends if you take the time to try to learn
it. Some resources for learning VBA code include:
http://www.seattleaccess.org/downloads.htm
See the download "DAO - Back To Basics Compilation/Demo"
"Tom Wickerath, Jan/Feb 2007"
and Access Basics by Crystal:
http://www.accessmvp.com/Strive4Peace/Index.htm
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________