Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Make Table Querry behind sceens - without prompts 1

Status
Not open for further replies.

wz

Programmer
Feb 16, 2001
88
US
I would like to run 1 make-table querry and 2 apend querrys without the end user knowledge. The end user chooses the report (cmd button) and I need these events to happen in order for the report to generate.

I cannot do a run sql because the sql is too long.

p.s. I do not want prompts - Are you sure? to come up either.

any ideas?
 
g'day wz,

Code:
'disable user warnings
docmd.setwarnings false

'run a query or two
docmd.openquery "qryMyAppendQry1"
docmd.openquery "qryMyAppendQry2"
...

'put wranings back on
docmd.setwarnings true
msgbox("Actions completed")

Good luck fella,

JB
 
I cannot do a run sql because the sql is too long.

This seems unlikely in that Access allows approximately 64,000 characters in an SQL statement. A good way to run queries that do not return a recordset is:

CurrentDB.Execute strSQL
 
G'day Remou,

I wonder if the OP is running into a drama I resolved for a a client the other day. He has something like:

Code:
strSQL="SELECT blah.* FROM blah " & _
       "WHERE blah.id= " & _
       "AND ......"

this form of literature does not work for long string, the & _ has a limit.

I've not had time to look into what the limit is but if we broke "properly" and then resumed with strSQL=strSRL & ... all was fine.

This post rang bells of that incident.

Rock on,

JB


 
The limit, afaik, is 25 line continuation characters and, as you say, it can be worked-around. It is a very annoying limitation. :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top