Query Command Button Problem

S

Shari

On my form, I need to put a button to run a query. When using the toolbox in
the Design View, I use the Command Button Toolbar, then use Miscellaneous,
then Run Query. I select the correct one, and save it to the form. When I try
to use it, I get an error message, and it will not work. The error message is:

The Expression On Click you entered as the event property setting produced
the following error: A problem occurred while Microsoft Access was
communicating with the OLE server or ActiveX Control.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

I have queries set up to be able to search in each one of my fields, to
bring up a specific record. I would like to have buttons on my forms to use,
instead of switching in and out of different screens.
 
J

Jeanette Cunningham

Shari,
From your description I wonder if you are trying to set up a search form.
There is a downloadable search form here
http://www.allenbrowne.com/ser-62.html
It allows users to search on one field or several fields at the same time.
If this is what you need, it would be simpler for the users to understand
and use.

Jeanette Cunningham
 
S

Shari

No, that is not what I am trying to set up. I have my query already set up. I
am trying to create a button as a short-cut to the query.

Jeanette Cunningham said:
Shari,
From your description I wonder if you are trying to set up a search form.
There is a downloadable search form here
http://www.allenbrowne.com/ser-62.html
It allows users to search on one field or several fields at the same time.
If this is what you need, it would be simpler for the users to understand
and use.

Jeanette Cunningham

Shari said:
On my form, I need to put a button to run a query. When using the toolbox
in
the Design View, I use the Command Button Toolbar, then use Miscellaneous,
then Run Query. I select the correct one, and save it to the form. When I
try
to use it, I get an error message, and it will not work. The error message
is:

The Expression On Click you entered as the event property setting produced
the following error: A problem occurred while Microsoft Access was
communicating with the OLE server or ActiveX Control.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

I have queries set up to be able to search in each one of my fields, to
bring up a specific record. I would like to have buttons on my forms to
use,
instead of switching in and out of different screens.
 
J

Jeanette Cunningham

I'm not sure what you are wanting your button to do - it sounds unusual and
I suspect there is a more conventional way to do it.
If you want to show the results of the query, you would usually do that by
opening a form which has the query as its record source.
It's not a good idea to open a query for users, becuase you have no control
over what they can do with the query. They can basically destroy the query,
but not if you put it in a form.

Jeanette Cunningham

Shari said:
No, that is not what I am trying to set up. I have my query already set
up. I
am trying to create a button as a short-cut to the query.

Jeanette Cunningham said:
Shari,
From your description I wonder if you are trying to set up a search form.
There is a downloadable search form here
http://www.allenbrowne.com/ser-62.html
It allows users to search on one field or several fields at the same
time.
If this is what you need, it would be simpler for the users to understand
and use.

Jeanette Cunningham

Shari said:
On my form, I need to put a button to run a query. When using the
toolbox
in
the Design View, I use the Command Button Toolbar, then use
Miscellaneous,
then Run Query. I select the correct one, and save it to the form. When
I
try
to use it, I get an error message, and it will not work. The error
message
is:

The Expression On Click you entered as the event property setting
produced
the following error: A problem occurred while Microsoft Access was
communicating with the OLE server or ActiveX Control.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

I have queries set up to be able to search in each one of my fields, to
bring up a specific record. I would like to have buttons on my forms to
use,
instead of switching in and out of different screens.
 

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