PC Review


Reply
Thread Tools Rate Thread

How to Change Query to Delete Query in Macro

 
 
doyle60@aol.com
Guest
Posts: n/a
 
      2nd Mar 2005
I have a query that lists data that I wish to delete. The select query
allowed me to delete the data only if I put the word DISTINCTROW after
the word SELECT.

SELECT DISTINCTROW Categorytbl.*
FROM Categorytbl LEFT JOIN OrderHeader ON Categorytbl.CategoryID =
OrderHeader.CategoryID
WHERE (((OrderHeader.CategoryID) Is Null));

Without that word, I could not delete the data.

To change this query to a delete query, I usually stick it in a macro
(the name of the query being Sim200DeleteCategoryqry):

DELETE Sim200DeleteCategoryqry.*
FROM Sim200DeleteCategoryqry;

But I get the error: "Couldn't delete from specified tables." The
message, Error 3086, is about read-only business and permissions, which
just doesn't apply.

I'm only allowed to delete queries by this method if the link is to a
key field and the DISTINCTROW is not needed (see postings "How to allow
a Query to Delete Records").

So how do I make a workable delete query in a macro when it is based on
a query with DISTINCTROW?

Thanks,

Matt

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a delete query macro? Jason Microsoft Access Queries 2 14th Nov 2006 09:56 PM
running delete query or make table query from macro or event proce =?Utf-8?B?dHJhdmVsZXI=?= Microsoft Access Queries 3 1st Mar 2005 12:01 AM
Delete Query in Macro Hangs-up =?Utf-8?B?TmRlbDQw?= Microsoft Access Queries 3 12th Oct 2004 03:25 PM
'Sanity Check' - combine macro, delete query and make table query Mike Webb Microsoft Access Queries 2 17th Feb 2004 02:20 PM
delete records query / macro? tradmusic Microsoft Access 2 29th Jan 2004 12:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:48 AM.