Problem with Command Button on Click (1 Viewer)

pulledoutmyhair

Registered User.
Local time
Today, 08:27
Joined
Sep 29, 2009
Messages
11
Hi All,

I am having some serious issues with a simple search box and the cmd button (using embedded macro onclick)for it. everytime I click the button I get the message Object or Class does not support the set of events. Using access 2007. Copied the embedded macro from an access 2007 template.
Here is the embmacro:

Begin
Condition ="[Forms]![Customer List]![Searchbox] Is Null"
Action ="RunCommand"
Comment ="Clear Filter when search box
empty"
Argument ="144"
End
Begin
Condition ="..."
Action ="SetProperty"
Argument ="cmdShowAll"
Argument ="0"
Argument ="0"
End
Begin
Condition ="..."
Action ="StopAllMacros"
End
Begin
Action ="SetTempVar"

Comment ="Handle \"'s in search"
Argument ="strSearch"
Argument ="Replace([Forms]![Customer
List]![SearchBox],\"\"\"\",\"\"\"\"\"\")"
End
Begin
Comment ="Build the Filter"
End
Begin
Action ="SetTempVar"
Argument ="strFilter"
Argument ="\"([Last Name] Like \"\"*\" &
[TempVars]![strSearch] & \"*\"\")\""
End
Begin
Action ="SetTempVar"
Argument ="strFilter"
Argument ="[TempVars]![strFilter] & \" OR
([First Name] Like \"\"*\" &
[TempVars]![strSearc"
"h] & \"*\"\")\""
End
Begin
Action ="SetTempVar"
Argument ="strFilter"
Argument ="[TempVars]![strFilter] & \" OR
([E-mail Address] Like \"\"*\" &
[TempVars]![strS"
"earch] & \"*\"\")\""
End
Begin
Action ="SetTempVar"
Argument ="strFilter"
Argument ="[TempVars]![strFilter] & \" OR
([Job Title] Like \"\"*\" &
[TempVars]![strSearch"
"] & \"*\"\")\""
End
Begin
Action ="SetTempVar"
Argument ="strFilter"
Argument ="[TempVars]![strFilter] & \" OR
([Mobile Phone] Like \"\"*\" &
[TempVars]![strSea"
"rch] & \"*\"\")\""
End
Begin
Action ="SetTempVar"
Argument ="strFilter"
Argument ="[TempVars]![strFilter] & \" OR
([Business Phone] Like \"\"*\" &
[TempVars]![strS"
"earch] & \"*\"\")\""
End
Begin
Action ="ApplyFilter"
Argument =""
Argument ="=[TempVars]![strFilter]"
End
Begin
Action ="RemoveTempVar"
Argument ="strFilter"
End
Begin
Action ="RemoveTempVar"
Argument ="strSearch"
End
Begin
Action ="SetProperty" Picture: Search.bmp
Argument ="cmdShowAll"
Argument ="0"
Argument ="1"
End
 

missinglinq

AWF VIP
Local time
Today, 03:27
Joined
Jun 20, 2003
Messages
6,423
Don't run 2007, but you say "Copied the embedded macro from an access 2007 template."

There are several references in the posted code to specific forms/controls. Did you replace them with the actual names of your own forms/controls?
 

pulledoutmyhair

Registered User.
Local time
Today, 08:27
Joined
Sep 29, 2009
Messages
11
Don't run 2007, but you say "Copied the embedded macro from an access 2007 template."

There are several references in the posted code to specific forms/controls. Did you replace them with the actual names of your own forms/controls?

I am using Access 2007, yes I replaced all the names to those of my own controls and forms. The odd thing is, it started working again. And the only thing I did was to change the picture on the cmd button and remove the display text!?!?:confused:
 

pulledoutmyhair

Registered User.
Local time
Today, 08:27
Joined
Sep 29, 2009
Messages
11
OK quick update. It was working yesterday afternoon. Just went to use it today and now getting same error message!!!!!!! Help me please someone!!! All I want is a command button that will use the contents of a text box to search
 

pulledoutmyhair

Registered User.
Local time
Today, 08:27
Joined
Sep 29, 2009
Messages
11
Ok this is really getting me confused now. It works then I come in the next day and it stops working. Yesterday morning it wouldn't work, didn't change anything and it started to work. Came in this morning and it wouldn't work!!!!! WTF is going on.?!?!?
 

dbDamo

Registered User.
Local time
Today, 08:27
Joined
May 15, 2009
Messages
395
Can you upload your Database, minus any sensitive data. Will be much easier to see whats going wrong.
 

pulledoutmyhair

Registered User.
Local time
Today, 08:27
Joined
Sep 29, 2009
Messages
11
Can you upload your Database, minus any sensitive data. Will be much easier to see whats going wrong.

I can't get it to zip to a small enough size. I can use winrar to compress it enough but unfortunately I can't upload winrar files. Can I email it to you??
 

dbDamo

Registered User.
Local time
Today, 08:27
Joined
May 15, 2009
Messages
395
Upload it to a file hosting site and post the link here. I'll have a look when I get home Tonight as I don't have 2007 at work.
 

dbDamo

Registered User.
Local time
Today, 08:27
Joined
May 15, 2009
Messages
395
I'll have a look when I get home Tonight mate, running 2002 at work
 

Users who are viewing this thread

Top Bottom