Access 2003 to 2007

M

Martin Racette

Hi,

I have a database that I use to keep track of wich DVDs I own, and in it I
got a macro that when I select an actor's name it will show me a the DVDs
that this actor is in.

Since upgrading to Office 2007, the macro does work for the first actor but
when I select another one the goes back to the first name
 
S

Steve Schapel

Martin,

Can you please let us know the details of the macro, i.e. what Actions
it uses, and also what Event the macro is run on? Thanks.
 
M

Martin Racette

Here's the coding for the macro:

Name: ActorListing
[Forms]![Listing of Actor]![ActorName] Applyfilter, StopMacro

and it is acting on the OnClick event of an Unbound ComboBox named ActorName
which is filled with the actor's name using a query
 
S

Steve Schapel

Thanks Martin.

In the information you gave, where do you see this:
[Forms]![Listing of Actor]![ActorName]
Is it in the Condition column of the macro design, or is in in one of
the Argument boxes ('Filter Name' or 'Where Condition') at the bottom of
the macro design window when your cursor is in the ApplyFilter row? If
not, can you say what is in these Argument boxes please?
 
M

Martin Racette

Here it is

Macro Name: ActorListing
Condition: [Forms]![Listing of Actor]![ActorName]
Action: ApplyFilter
StopMacro

At the bottom Filter Name is Empty, Where Condition as the Condition
mentioned above, Control Name is empty

Steve Schapel said:
Thanks Martin.

In the information you gave, where do you see this:
[Forms]![Listing of Actor]![ActorName]
Is it in the Condition column of the macro design, or is in in one of the
Argument boxes ('Filter Name' or 'Where Condition') at the bottom of the
macro design window when your cursor is in the ApplyFilter row? If not,
can you say what is in these Argument boxes please?

--
Steve Schapel, Microsoft Access MVP

Martin said:
Here's the coding for the macro:

Name: ActorListing
[Forms]![Listing of Actor]![ActorName] Applyfilter, StopMacro

and it is acting on the OnClick event of an Unbound ComboBox named
ActorName which is filled with the actor's name using a query
 
S

Steve Schapel

Martin,

First of all, the StopMacro action is not achieving anything. It is
redundant and can be removed.

Having something like [Forms]![Listing of Actor]![ActorName] in the
macro Condition is not valid. This is supposed to be an expression that
evaluates to True or False, to determine whether the macro actually
runs. I think maybe it should be like this:
[ActorName] Is Not Null

It is not correct to be using the Click event of the combobox here. You
should be using the After Update event of the ActorName combobox.

Having something like [Forms]![Listing of Actor]![ActorName] in the
Where Condition argument is not valid. This is supposed to be an
expression that refers to the value of field(s) in the form's record
source. I think maybe it should be like this:
[ActorName]=[Forms]![Listing of Actor]![ActorName]
 
M

Martin Racette

I'm not sure that I understand what you mean

That macro was woking perfectly well in 2003 and now it's only working the
first time that I use it, and I made it with the help of people from this
same group

Could you please give me a programming that will work in the case that I
need

Steve Schapel said:
Martin,

First of all, the StopMacro action is not achieving anything. It is
redundant and can be removed.

Having something like [Forms]![Listing of Actor]![ActorName] in the macro
Condition is not valid. This is supposed to be an expression that
evaluates to True or False, to determine whether the macro actually runs.
I think maybe it should be like this:
[ActorName] Is Not Null

This filed can not be Null at all since it's already populated by a query
It is not correct to be using the Click event of the combobox here. You
should be using the After Update event of the ActorName combobox.

There is no Update at all since the click provide the update, this field is
an unbound field, so from what I understood when it was explained to me the
click event provide the Update
Having something like [Forms]![Listing of Actor]![ActorName] in the Where
Condition argument is not valid. This is supposed to be an expression
that refers to the value of field(s) in the form's record source. I think
maybe it should be like this:
[ActorName]=[Forms]![Listing of Actor]![ActorName]

I don't understand what that does, it seems to be a circular event i.e.:
that a variable refer to itself
--
Steve Schapel, Microsoft Access MVP

Martin said:
Here it is

Macro Name: ActorListing
Condition: [Forms]![Listing of Actor]![ActorName]
Action: ApplyFilter
StopMacro

At the bottom Filter Name is Empty, Where Condition as the Condition
mentioned above, Control Name is empty
 
S

Steve Schapel

Martin,

There must be some mistake. There is no way this macro as you had it
would work in Access 2003.
 
M

Martin Racette

Well, that was the way I was told to programmed it, and it was working very
well, but as soon as I upgraded to 2007, it began to work for the first
choice I made, and then nothing else

If you're telling me that it shouldn't work, then could you please tell me
how to program it
 
M

Martin Racette

That code that you provided, when I tried it all it did was to show a dialog
box requiring the name, I'm using an combox to provide the since I can in
all logic remember over 7000 names amd their correct spelling, specially
since thare are some foreign spelling as well


Steve Schapel said:
Martin,

First of all, the StopMacro action is not achieving anything. It is
redundant and can be removed.

Having something like [Forms]![Listing of Actor]![ActorName] in the macro
Condition is not valid. This is supposed to be an expression that
evaluates to True or False, to determine whether the macro actually runs.
I think maybe it should be like this:
[ActorName] Is Not Null

It is not correct to be using the Click event of the combobox here. You
should be using the After Update event of the ActorName combobox.

Having something like [Forms]![Listing of Actor]![ActorName] in the Where
Condition argument is not valid. This is supposed to be an expression
that refers to the value of field(s) in the form's record source. I think
maybe it should be like this:
[ActorName]=[Forms]![Listing of Actor]![ActorName]

--
Steve Schapel, Microsoft Access MVP

Martin said:
Here it is

Macro Name: ActorListing
Condition: [Forms]![Listing of Actor]![ActorName]
Action: ApplyFilter
StopMacro

At the bottom Filter Name is Empty, Where Condition as the Condition
mentioned above, Control Name is empty
 

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