473,513 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Specify Table containing the Records you want to Delete" Problem

Hi:

Access 2000 W98!

I have a table with numerous records in it, and am attempting to delete certain records
that have been selected from it. These are selected based on the ID number in a different
table. While I am using the tools in Access for query setup, its easier to show it on here
using the SQL for the query, which is as follows( the table is [Investment Action Units]):

DELETE [Investment Action Units].date, [Investment Action Units].[Action name],
[Investment Action Units].Units, [Investment Action Units].Value, [Investment Action
Units].Remarks
FROM [Investment Action Units] INNER JOIN Parms ON [Investment Action Units].[Investment
Name ID] = Parms.[Invest ID];

When I try and run the query, I get a message "Specify Table containing the Records you
want to Delete". Since I already have specified the table I don't know what else I should
do. I certainly want to select ONLY those records where there is a match in Parms, and not
erase the whole table.

Advice is appreciated.

Regards

John Baker
Nov 13 '05 #1
8 25028
DELETE * FROM [Investment Action Units] WHERE [Investment Action
Units].[Investment Name ID] = Parms.[Invest ID]

Never tried to delete using a join; I assume that that is where the problem
is.
Darryl Kerekslager

"John Baker" <Ba******@Verizon.net> wrote in message
news:ls********************************@4ax.com...
Hi:

Access 2000 W98!

I have a table with numerous records in it, and am attempting to delete certain records that have been selected from it. These are selected based on the ID number in a different table. While I am using the tools in Access for query setup, its easier to show it on here using the SQL for the query, which is as follows( the table is [Investment Action Units]):
DELETE [Investment Action Units].date, [Investment Action Units].[Action name], [Investment Action Units].Units, [Investment Action Units].Value, [Investment Action Units].Remarks
FROM [Investment Action Units] INNER JOIN Parms ON [Investment Action Units].[Investment Name ID] = Parms.[Invest ID];

When I try and run the query, I get a message "Specify Table containing the Records you want to Delete". Since I already have specified the table I don't know what else I should do. I certainly want to select ONLY those records where there is a match in Parms, and not erase the whole table.

Advice is appreciated.

Regards

John Baker

Nov 13 '05 #2
With the posted SQL, it is likely that JET will treat [Parms].[InvestID] as
a Parameter and ask the user for the Parameter value since the Table [Parms]
is not in the FROM clause.

--
HTH
Van T. Dinh


"Darryl Kerkeslager" <Ke*********@comcast.net> wrote in message
news:Zb********************@comcast.com...
DELETE * FROM [Investment Action Units] WHERE [Investment Action
Units].[Investment Name ID] = Parms.[Invest ID]

Never tried to delete using a join; I assume that that is where the problem is.
Darryl Kerekslager

Nov 13 '05 #3
See the Microsoft Knowledge Base article:

http://support.microsoft.com/?id=207761

--
HTH
Van T. Dinh


"John Baker" <Ba******@Verizon.net> wrote in message
news:ls********************************@4ax.com...
Hi:

Access 2000 W98!

I have a table with numerous records in it, and am attempting to delete certain records that have been selected from it. These are selected based on the ID number in a different table. While I am using the tools in Access for query setup, its easier to show it on here using the SQL for the query, which is as follows( the table is [Investment Action Units]):
DELETE [Investment Action Units].date, [Investment Action Units].[Action name], [Investment Action Units].Units, [Investment Action Units].Value, [Investment Action Units].Remarks
FROM [Investment Action Units] INNER JOIN Parms ON [Investment Action Units].[Investment Name ID] = Parms.[Invest ID];

When I try and run the query, I get a message "Specify Table containing the Records you want to Delete". Since I already have specified the table I don't know what else I should do. I certainly want to select ONLY those records where there is a match in Parms, and not erase the whole table.

Advice is appreciated.

Regards

John Baker

Nov 13 '05 #4
Thats exactly what happened!!!
"Van T. Dinh" <Va***********@discussions.microsoft.com> wrote:
With the posted SQL, it is likely that JET will treat [Parms].[InvestID] as
a Parameter and ask the user for the Parameter value since the Table [Parms]
is not in the FROM clause.


Nov 13 '05 #5

Unfortunatley none of these solves the problem I am having. It still does not know what
table I was to delete from.

Is there any good article about delete queries out there?
Best

John
"Van T. Dinh" <Va***********@discussions.microsoft.com> wrote:
See the Microsoft Knowledge Base article:

http://support.microsoft.com/?id=207761


Nov 13 '05 #6
Please post the SQL String of your Query.

--
Van T. Dinh


"John Baker" <Ba******@Verizon.net> wrote in message
news:2b********************************@4ax.com...

Unfortunatley none of these solves the problem I am having. It still does not know what table I was to delete from.

Is there any good article about delete queries out there?
Best

John
"Van T. Dinh" <Va***********@discussions.microsoft.com> wrote:
See the Microsoft Knowledge Base article:

http://support.microsoft.com/?id=207761

Nov 13 '05 #7
John Baker wrote:
Hi:

Access 2000 W98!

I have a table with numerous records in it, and am attempting to delete certain records
that have been selected from it. These are selected based on the ID number in a different
table. While I am using the tools in Access for query setup, its easier to show it on here
using the SQL for the query, which is as follows( the table is [Investment Action Units]):

DELETE [Investment Action Units].date, [Investment Action Units].[Action name],
[Investment Action Units].Units, [Investment Action Units].Value, [Investment Action
Units].Remarks
FROM [Investment Action Units] INNER JOIN Parms ON [Investment Action Units].[Investment
Name ID] = Parms.[Invest ID];

When I try and run the query, I get a message "Specify Table containing the Records you
want to Delete". Since I already have specified the table I don't know what else I should
do. I certainly want to select ONLY those records where there is a match in Parms, and not
erase the whole table.

Advice is appreciated.

Regards

John Baker


DELETE * FROM [Investment Action Units] INNER JOIN Parms ON
[Investment Action Units].[Investment
Name ID] = Parms.[Invest ID];

Delete syntax is funny in Access in that you specify columns whereas the
delete command works on a row but in general you use "delete * from" to
delete the record, I think you confused it with all the column names in
the there.

If your intention was to delete the contents of those columns and not
delete the rows themselves (i.e. set them to null) then you should use
an update query.
--
Pretentious? Moi?
Nov 13 '05 #8
Ahhhh
Thanks very much. Yes, I have found the delete to be very odd, and not totally consistent
with the other query commands.

Thanks
John

Trevor Best <nospam@localhost> wrote:
John Baker wrote:
Hi:

Access 2000 W98!

I have a table with numerous records in it, and am attempting to delete certain records
that have been selected from it. These are selected based on the ID number in a different
table. While I am using the tools in Access for query setup, its easier to show it on here
using the SQL for the query, which is as follows( the table is [Investment Action Units]):

DELETE [Investment Action Units].date, [Investment Action Units].[Action name],
[Investment Action Units].Units, [Investment Action Units].Value, [Investment Action
Units].Remarks
FROM [Investment Action Units] INNER JOIN Parms ON [Investment Action Units].[Investment
Name ID] = Parms.[Invest ID];

When I try and run the query, I get a message "Specify Table containing the Records you
want to Delete". Since I already have specified the table I don't know what else I should
do. I certainly want to select ONLY those records where there is a match in Parms, and not
erase the whole table.

Advice is appreciated.

Regards

John Baker


DELETE * FROM [Investment Action Units] INNER JOIN Parms ON
[Investment Action Units].[Investment
Name ID] = Parms.[Invest ID];

Delete syntax is funny in Access in that you specify columns whereas the
delete command works on a row but in general you use "delete * from" to
delete the record, I think you confused it with all the column names in
the there.

If your intention was to delete the contents of those columns and not
delete the rows themselves (i.e. set them to null) then you should use
an update query.


Nov 13 '05 #9

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

Similar topics

2
2250
by: aiKeith | last post by:
I have a really stupid problem I'm hoping to get help with. The problem occurs if I delete rows from a dynamically built datatable. ie: CreateDataTable(); // creates the structure of the...
5
5404
by: lottaviano | last post by:
I am using Access 2002 and have two tables (Main and Actions) linked (in Relationships) on one field "CAL_ID" (primary key in Main Table). Main Table is a list of equipment. Actions Table lists...
1
1365
by: Michael Ramey | last post by:
Hi, I'm dynamically creating a table of "delete" imagebuttons, that correspond to files on the webserver. I want to respond to clicks of these buttons, so I know to know what file to delete. ...
4
1529
by: papaja | last post by:
Hi, I posted this on asp.net forums already, but nobody answered it. Here is direct link: http://forums.asp.net/1124640/ShowPost.aspx. Here is the question: I'm using this code in delete...
10
3931
by: cyber0ne | last post by:
I'm having a bit of trouble adding records to a local .DB file (using a Paradox connection string). I checked the file permissions, and for testing purposes set Everyone to Full access. But it...
4
15732
by: Mike D | last post by:
OS: Windows XP Professional Microsoft Access 2003 I am trying to update a table in my DB from a tempory table. I need to ensure that if records in the main table match records in the temp...
19
10728
by: Daniel Pitts | last post by:
I have std::vector<Base *bases; I'd like to do something like: std::for_each(bases.begin(), bases.end(), operator delete); Is it possible without writing an adapter? Is there a better way? Is...
0
1647
by: Cirene | last post by:
Can you assist me with this database problem? I have 4 tables in my db.... Table1 (key: Table1Id) Table2 (key: Table2Id) Table3 (key: Table3Id) Table 4 has these fields: key: Table4Id...
2
3371
jbt007
by: jbt007 | last post by:
All, Access 2003 - WinXP I thought this would be a no brainer, but it seems to be a perplexing problem. I have a simple table I use for importing several text reports, use VBA to run through...
0
7260
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
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7539
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7101
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
7527
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
3223
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1597
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.