Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Receiving error on contact database

19 views
Skip to first unread message

tcd2004

unread,
Jun 4, 2009, 2:18:01 PM6/4/09
to
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

Klatuu

unread,
Jun 4, 2009, 3:45:01 PM6/4/09
to
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

unread,
Jun 4, 2009, 3:52:01 PM6/4/09
to
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

unread,
Jun 4, 2009, 5:31:01 PM6/4/09
to
Use a GoToControl action in your macro
0 new messages