Results 1 to 2 of 2
  1. #1
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Dec 2010
    Posts
    209

    Delete A Query Through VBA

    I am attempting to delete a query that as you can see in my screenshot exists, but my vba gives the error
    Run-time error '2059':
    Microsoft Access can not find the object 'qryExport'

    This is the code I have
    Code:
    DoCmd.DeleteObject acQuery = acDefault, "qryExport"

    But as you see in the image below it clearly exists!


    Click image for larger version. 

Name:	Capture.PNG 
Views:	13 
Size:	30.5 KB 
ID:	41044

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    you just need

    DoCmd.DeleteObject acQuery, "qryExport"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Delete query to delete records that meet criteria
    By neill_long in forum Queries
    Replies: 1
    Last Post: 06-11-2018, 02:41 PM
  2. Replies: 7
    Last Post: 09-16-2017, 04:01 PM
  3. Delete Button vs. Delete Query
    By JennyL in forum Access
    Replies: 4
    Last Post: 02-11-2017, 10:11 PM
  4. Replies: 2
    Last Post: 01-24-2012, 02:16 PM
  5. Trying to Delete record using delete query
    By MooseOTL in forum Access
    Replies: 13
    Last Post: 10-04-2011, 02:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums