Trying to run queries through a command button

DDONNI

Registered User.
Local time
Today, 10:48
Joined
Sep 10, 2004
Messages
22
Hi Guys i'm now trying to create a form as a menu where i can execute Macros at the click of a button and also to generate reports. The problem i've got is i'm trying to setup a command button to run a set of queries but i can't seem to find a way of doing this. I've tried to add the query to a macro and then add the macro to the command button but i can't seem to find an option to add a query to a macro i've also tried copying the sql code from the query and putting it into the command button but the code is quite large well over 4000 characters and it said the limit was just over 2000. Does anyone have any ideas.

Also if you have any ideas on my other formatting Thread i would be grateful.

Cheers.
 
Use the OPENQUERY command in your macro, you can add as many as you like.
 
I've tried this but it only allows you to read, edit or add. the query is appending an existing table i don't want to be able to see the query i just want to make it run at the click of a button.

Any other ideas?
 
First make sure your QUERY is an APPEND query (not select).
Use SetWarnings FALSE in your macro to turn off the warnings
Use OpenQuery to run the query

I do this ALL the time. I suspect your query is not set to APPEND mode.
 
Cheers mate thats great its working now i don't know what i was doing wrong before i think i had it set to edit. but i am running an append query.
 

Users who are viewing this thread

Back
Top Bottom