Delete Query Button on a form

A

accesscrazy

Hi,

I have a delete query and want to place a button on a form to run it. When I
create a button in design and run the wizard my delete query does not appear
in the queries window.

How would I create the button other than in the wizard.

Thanx
 
K

Klatuu

In design view, select the button, click on properties, select the Events
tab, put your cursor on the On Click event box. Click the button to the
right with three dots. Select code builder. Enter this code:

CurrentDb.Execute("Your query name goes here"), dbFailOnError
 
A

accesscrazy

Thanx, But it does not work..



Klatuu said:
In design view, select the button, click on properties, select the Events
tab, put your cursor on the On Click event box. Click the button to the
right with three dots. Select code builder. Enter this code:

CurrentDb.Execute("Your query name goes here"), dbFailOnError
 
K

Klatuu

Why not?
Post your code and what errors you are getting.
We can't help if we don't know what the problem is.
 
A

accesscrazy

Got better advice on the query page, thanx.

Create a macro.... easy simple and effective, plus it works 1st time.

Accesscrazy
 
K

Klatuu

Glad you got your problem resolved. Maybe you got better advice because you
gave a better description of the problem.
 
A

accesscrazy

Actually i gave less info...

Klatuu said:
Glad you got your problem resolved. Maybe you got better advice because you
gave a better description of the problem.
 
K

Klatuu

What I originally sent does work, if you do it correctly.
Those of us who participate here do it voluntarily in an effort to help
others and, in turn, when we hit a problem, have a place to go for
assistance. If you choose to ask for help, give very little information on
the problem, and then be rude to the people trying to help, I think many of
use will remember your name and ignore your posts.
 
Top