Receiving error on contact database


T

tcd2004

I'm trying to help out a friend who is creating a contact list in Access 2007
for a hair salon and we are running into an error message. The error comes
up when we do a search, and then click the show all button next to the search
box. The first dialog box pops up with this error message:

"contact management database"
"you can't disable a control while it has the focus."

When Ok is clicked, this error box shows up:

"action failed"

Macro Name:
Contact List : cmdShowAll : OnClick : Embedded Macro

Condition:
True

Action Name:
SetValue

Arguments:
[Forms]![Contact List]![cmdShowAll].[Enabled], 0

Error Number:
2950

On the second error box, the only option available to click is "stop all
macros" It is strange because sometimes we would run a search for a persons
name, then click the show all button to get back to the entire list, and
there would be no error. More times than not though the error will show up.
As I said, it is a list for a hair salon so it is important that this be
error free by the time it goes to them. Any idea what would be causing this?
Thanks
 
Ad

Advertisements

K

Klatuu

You are getting the error when the Show All button has the focus because this
line disables the control:

Arguments:
[Forms]![Contact List]![cmdShowAll].[Enabled], 0

You don't always get the error because it may be possible that the focus is
no longer on the button. To avoid getting the error put a line at the
beginning of your macro that moves the focus to a different control.
 
T

tcd2004

Thank you for you answer. What you said makes sense, however how would I go
about doing that? I wish I was more proficient in Access, but I am just
starting to use it again after a long while. Thanks again.

Klatuu said:
You are getting the error when the Show All button has the focus because this
line disables the control:

Arguments:
[Forms]![Contact List]![cmdShowAll].[Enabled], 0

You don't always get the error because it may be possible that the focus is
no longer on the button. To avoid getting the error put a line at the
beginning of your macro that moves the focus to a different control.
--
Dave Hargis, Microsoft Access MVP


tcd2004 said:
I'm trying to help out a friend who is creating a contact list in Access 2007
for a hair salon and we are running into an error message. The error comes
up when we do a search, and then click the show all button next to the search
box. The first dialog box pops up with this error message:

"contact management database"
"you can't disable a control while it has the focus."

When Ok is clicked, this error box shows up:

"action failed"

Macro Name:
Contact List : cmdShowAll : OnClick : Embedded Macro

Condition:
True

Action Name:
SetValue

Arguments:
[Forms]![Contact List]![cmdShowAll].[Enabled], 0

Error Number:
2950

On the second error box, the only option available to click is "stop all
macros" It is strange because sometimes we would run a search for a persons
name, then click the show all button to get back to the entire list, and
there would be no error. More times than not though the error will show up.
As I said, it is a list for a hair salon so it is important that this be
error free by the time it goes to them. Any idea what would be causing this?
Thanks
 
Ad

Advertisements

K

Klatuu

Use a GoToControl action in your macro
--
Dave Hargis, Microsoft Access MVP


tcd2004 said:
Thank you for you answer. What you said makes sense, however how would I go
about doing that? I wish I was more proficient in Access, but I am just
starting to use it again after a long while. Thanks again.

Klatuu said:
You are getting the error when the Show All button has the focus because this
line disables the control:

Arguments:
[Forms]![Contact List]![cmdShowAll].[Enabled], 0

You don't always get the error because it may be possible that the focus is
no longer on the button. To avoid getting the error put a line at the
beginning of your macro that moves the focus to a different control.
--
Dave Hargis, Microsoft Access MVP


tcd2004 said:
I'm trying to help out a friend who is creating a contact list in Access 2007
for a hair salon and we are running into an error message. The error comes
up when we do a search, and then click the show all button next to the search
box. The first dialog box pops up with this error message:

"contact management database"
"you can't disable a control while it has the focus."

When Ok is clicked, this error box shows up:

"action failed"

Macro Name:
Contact List : cmdShowAll : OnClick : Embedded Macro

Condition:
True

Action Name:
SetValue

Arguments:
[Forms]![Contact List]![cmdShowAll].[Enabled], 0

Error Number:
2950

On the second error box, the only option available to click is "stop all
macros" It is strange because sometimes we would run a search for a persons
name, then click the show all button to get back to the entire list, and
there would be no error. More times than not though the error will show up.
As I said, it is a list for a hair salon so it is important that this be
error free by the time it goes to them. Any idea what would be causing this?
Thanks
 

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