473,387 Members | 1,303 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,387 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 12293
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.