?
Solved

How do I delete a query in Access 2010?

Posted on 2011-05-06
36
Medium Priority
?
1,024 Views
Last Modified: 2012-05-11
I would like to delete a query from Access 2010, but I can't seem to find an option to do it anywhere.
0
Comment
Question by:geeta_m9
  • 18
  • 15
  • 3
36 Comments
 
LVL 75
ID: 35708660
You should be able to Right Click over the query name and Delete - see image.

mx
Capture1.gif
0
 

Author Comment

by:geeta_m9
ID: 35708677
I tried doing that, but the delete is grayed out (disabled) for some reason.
0
 
LVL 75
ID: 35708697
humm .... can you post a screen shot.

Is the db possibly opened as Read Only?

mx
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 49

Expert Comment

by:Dale Fye
ID: 35708712

Don't have 2010, but you could try the following in the immediate window:

docmd.DeleteObject acQuery, "qryActualsGroup"
0
 

Author Comment

by:geeta_m9
ID: 35708726
It looks like the screen shot you sent me, but the delete option is "grayed out".
0
 
LVL 75
ID: 35708745
Guessing if Delete is grayed out ... that probably not work.

geeta_m9.  Did you possibly open the db from a Zip file, or directly on a CD Rom ?

mx
0
 

Author Comment

by:geeta_m9
ID: 35708746
Is acQuery the name of the query?
0
 

Author Comment

by:geeta_m9
ID: 35708754
I opened if from a shortcut on my desktop. The database is on a network drive. I can delete tables and records, just can't seem to delete the queries for some reason.
0
 
LVL 75
ID: 35708764
"Is acQuery the name of the query?'
That is the Object Type specified for the Delete action.
acTable, acForm ... etc ...

mx
0
 

Author Comment

by:geeta_m9
ID: 35708776
Fved, So what's in quotes is the name of the query I want to delete?
0
 
LVL 75
ID: 35708789
What happens if you right click over a Form, Report, Table .... is Delete grayed out ?

mx
0
 

Author Comment

by:geeta_m9
ID: 35708805
Yes, it's grayed out for those objects too.
0
 

Author Comment

by:geeta_m9
ID: 35708820
I'm sorry, mx, I take it back. I was able to delete a table from another Access database, it wasn't this one.
0
 

Author Comment

by:geeta_m9
ID: 35708826
So it looks like I can't delete anything from this database. Maybe it was set that way as a precaution, but I don't know how to undo it.
0
 
LVL 49

Expert Comment

by:Dale Fye
ID: 35708833
Yes, what is in quotes is the name of the query you want to delete.  I used MX's image as my example
0
 
LVL 75
ID: 35708847
Your DB has been opened as Read Only.

Take a look at the Properties for the desktop Shortcut ... see what the actual command is ... post that.

mx
0
 

Author Comment

by:geeta_m9
ID: 35708849
How do I access the "immediate window"?
0
 
LVL 75
ID: 35708868
geeta_m9: If Delete is grayed out, I'm 99% sure the vba command will not work, but you can certainly try it. But please ... first ... check your desktop shortcut as I described.

OR ... it could be such that you do not have correct permissions on the server / folder to do this.

mx
0
 

Author Comment

by:geeta_m9
ID: 35708878
Here is a screenshot
Digger.jpg
0
 
LVL 49

Assisted Solution

by:Dale Fye
Dale Fye earned 100 total points
ID: 35708881
Well, now that that [cannot delete anything] is cleared up, my guess is that you only have read permissions on the folder that the actual database is installed in.

OR

As MX surmises, that the database properties are "read only"
0
 

Author Comment

by:geeta_m9
ID: 35708884
How do I get the permissions?
0
 

Author Comment

by:geeta_m9
ID: 35708890
But I can create new queries and tables, forms, etc. Just can't delete them.
0
 
LVL 75
ID: 35708922
I see the problem.
This db has been Secured.  There is a secured MDW.  This is an Access 2003 running in the A2010 environment, so ULS (User Level Security) still works.

You will need to get the correct permissions from whoever set this up.  There is nothing more we can really do.  You do not have Delete permission per the ULS settings.

mx
0
 
LVL 75
ID: 35708932
see image
Capture1.gif
0
 
LVL 75
ID: 35708937
It almost looks like you are trying to open the MDW file itself.  Is there more in that Target past

\secured.mdw .... ?

mx
0
 

Author Comment

by:geeta_m9
ID: 35708938
So only the person who set it up can grant the permissions? That person left a long time ago...what should I do?

0
 

Author Comment

by:geeta_m9
ID: 35708947
"C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE" "\\Asntdomain1.cas.unc.edu\users\learning\share\digger\databases\digger datasystem.mdb" /wrkgrp "\\Asntdomain1.cas.unc.edu\users\learning\share\digger\databases\secured.mdw
0
 
LVL 75
ID: 35708957
Hard to say.  You will need to get the correct User Names and Passwords to login into that db.

But again ... Is there more in that Target past

\secured.mdw .... ?
0
 

Author Comment

by:geeta_m9
ID: 35708993
No that's it.
0
 
LVL 75
ID: 35709074
Will ... then that is not a database, which would be MDB.  MDW is the secured WorkGroup File that is used to secure MDB's in A2003 or prior, but no longer supported in the ACCDB format.

There is nothing you can ... or should want ... to do the an MDW file.

mx
0
 

Author Comment

by:geeta_m9
ID: 35709121
So basically, I cannot delete these objects?
0
 
LVL 75
ID: 35709154
No, and nor would you want to.
Seems your desktop short cut is incorrect.
The MDW is not intended to be opened manually.  It's controlled by the Workgroup Administrator tool only.

mx
0
 
LVL 75
ID: 35709173
It's also possible someone changed the extension on an MDB to MDW ... for whatever reason.  Because I don't think you can do ANYTHING in a real MDW file - like add queries or other objects.

So ... this is another possibility.  But no matter, it is what it is ...

mx
0
 

Author Comment

by:geeta_m9
ID: 35709184
Well, the database name is in the first part of the shortcut: C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE" "\\Asntdomain1.cas.unc.edu\users\learning\share\digger\databases\digger datasystem.mdb" /wrkgrp "\\Asntdomain1.cas.unc.edu\users\learning\share\digger\databases\secured.mdw
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 400 total points
ID: 35709219
There you go then.  The MDB is *definitely* secured ... so, unless you can get the login and password necessary to make changes as a developer, this is really nothing you can do.  And sadly, there is not a whole lot more to say about it ...

C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE" "\\Asntdomain1.cas.unc.edu\users\learning\share\digger\databases\digger datasystem.mdb" /wrkgrp "\\Asntdomain1.cas.unc.edu\users\learning\share\digger\databases\secured.mdw

That path/target tells the entire story now.

Sorry ...

mx
0
 

Author Closing Comment

by:geeta_m9
ID: 35709808
Didn't solve my problem, but I appreciated the help and information.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question