473,418 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

make table query

ken
Hi,
I use this command to run a make table query without opening it...
CurrentDb.Execute "make table query name"
Access tells me that it can't execute a select query...? Its a make
table query not a select? Or are those two the same.

Bottom line is that the DoCmd.OpenQuery alowes the user to see the
query and I don't want that...

Anything else I could use other then Currentdb.execute?

Dec 19 '05 #1
4 12299
Ken:

What, exactly, do you want to accomplish? A MakeTable query
makes a table, thus the name. If the table already exists, the
Execute statement will give you an error that the table exists.

So, if you want to replace the table, try running a drop table
command first
DoCmd.Execute "Drop Table tblYourTable"

Be warned, that this will delete your table and all its data.

--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast
"ken" <ge****@gmail.com> wrote ...
Hi,
I use this command to run a make table query without opening it...
CurrentDb.Execute "make table query name"
Access tells me that it can't execute a select query...? Its a make
table query not a select? Or are those two the same.

Bottom line is that the DoCmd.OpenQuery alowes the user to see the
query and I don't want that...

Anything else I could use other then Currentdb.execute?

Dec 19 '05 #2
The code below deletes records from an existing table, then runs an append
query to add records to that table; all without user input or interference.
-Ed

DoCmd.SetWarnings False
DoCmd.OpenTable "tblZZZ"
DoCmd.RunCommand acCmdSelectAllRecords
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.OpenQuery "qryMakeZZZ", acViewNormal, acEdit
DoCmd.close acTable, "tblZZZ"
DoCmd.SetWarnings True
"ken" <ge****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi,
I use this command to run a make table query without opening it...
CurrentDb.Execute "make table query name"
Access tells me that it can't execute a select query...? Its a make
table query not a select? Or are those two the same.

Bottom line is that the DoCmd.OpenQuery alowes the user to see the
query and I don't want that...

Anything else I could use other then Currentdb.execute?

Dec 19 '05 #3
OUCH!

Dude, that's not the way to do this. Again, what do you want to do?
Don't try to manipulate the table using Access menus. Write the sql.

If you want to make the table then make the table. If you want to
delete all records and append new ones, then do that.

Dim dbs As DAO.Database
Dim sSQL As String

Set dbs = CurrentDB()

' 1) Delete and append records
sSQL = "DELETE FROM tblZZZ"
dbs.Execute sSQL
sSQL = "INSERT INTO tblZZZ SELECT * FROM qryZZZ"
dbs.Execute sSQL

' 2) Drop and recreate table
sSQL = "DROP TABLE tblZZZ"
dbs.Execute sSQL
sSQL = "SELECT * INTO tblZZZ FROM qryZZZ"
dbs.Execute sSQL

No menus, no RunCommand ... just pure SQL. It works, it's clean
it's readable, it's efficient. But first, you need to be clear about
what you wish to accomplish. I'm still not clear on that.
--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast
"Ed Robichaud" <ed*********@wdn.com> wrote ...
The code below deletes records from an existing table, then runs an append query to add records to that table; all
without user input or interference.
-Ed

DoCmd.SetWarnings False
DoCmd.OpenTable "tblZZZ"
DoCmd.RunCommand acCmdSelectAllRecords
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.OpenQuery "qryMakeZZZ", acViewNormal, acEdit
DoCmd.close acTable, "tblZZZ"
DoCmd.SetWarnings True
"ken" <ge****@gmail.com> wrote in message news:11**********************@z14g2000cwz.googlegr oups.com...
Hi,
I use this command to run a make table query without opening it...
CurrentDb.Execute "make table query name"
Access tells me that it can't execute a select query...? Its a make
table query not a select? Or are those two the same.

Bottom line is that the DoCmd.OpenQuery alowes the user to see the
query and I don't want that...

Anything else I could use other then Currentdb.execute?


Dec 19 '05 #4
ken
Hi...yea I think..delete then execute is the way to go.

Thank you all very much...

Dec 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: PMB | last post by:
Thank you in advance for any and all assistance. I'm trying to use a make table query to pull the last transactionID, so I can use an append query to reset the transactionID to the next...
4
by: Oreo Bomb | last post by:
I have a secured database that contains a Read-Only group. This group has permissions to view reports, but cannot add, edit, or delete any DB objects. One of the reports the group needs access to...
2
by: Kathy Krizl | last post by:
I'm probably doing something stupid, but I have a make table query. One of the tables I reference has some check box fields in it. Their Data Type is Yes/No, their field property format is Yes/No,...
0
by: LesM | last post by:
This is a change of behaviour between Access 2000 SP3 and Access 2002 SP3. I have Progress table that is linked via ODBC into Access using OpenLink Lite for Progress 9.0b. For over a year, using...
3
by: Hanif Merali | last post by:
Hello, I'm having some difficulties creating a make table query. The source table which I'm basing the make table query has the fields: CIF BusLine1-2001 BusLine1-2002 BusLine1-2003...
7
by: rednexgfx_k | last post by:
All, Problem Summary: I've running about 30 make table queries via VBA in Access 2000, and my database goes from 14,000k to over 2,000,000k. In addition, the longer the procedure runs, the...
24
by: Bob Alston | last post by:
Anyone know a way to make all access to a linked table, in another Access MDB, read only? I really don't want all the hassle of implementing full access security. I can't do this at the server...
1
by: danijela.simunovic | last post by:
Hi! Is there a way that when I run a "make table query" and an "append query" that i won't be asked those 2 or 3 questions from access like :"you are about to run a make table...","the existing...
3
by: Robertf987 | last post by:
Hi, I'm a bit stuck with an access database. I'm using access 2000 if that's any help. Right, it's 3:40am right now and I'm rather tired, but I *hope* this makes sense. I have a table which...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.