Results 1 to 12 of 12
  1. #1
    skunkworks is offline Novice
    Windows 10 Access 2019
    Join Date
    Oct 2025
    Posts
    5

    query not showing in form design selection with command button

    When creating a command button in form design, a delete query does not show. The other query is visible.Click image for larger version. 

Name:	frm.png 
Views:	21 
Size:	146.1 KB 
ID:	53327

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I just tested this and DELETE query shows up for me. If you want to provide your db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,938
    works for me as well - perhaps the delete query is wrong in some way

  4. #4
    skunkworks is offline Novice
    Windows 10 Access 2019
    Join Date
    Oct 2025
    Posts
    5

    query not showing in form design selection with command button

    Here is db.
    Attached Files Attached Files

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,563
    All you need for qry1 is

    Code:
    DELETE tbl1.*
    FROM tbl1;
    You have WHERE in all the columns for the Delete row.?
    Despite that the query ran and deleted the records.

    Code:
    DELETE tbl1.author, tbl1.[last-month], tbl1.[this-month], tbl1.adj, tbl1.due, tbl1.[send-report], tbl1.country, tbl1.[hold-pmt], tbl1.method, tbl1.fee
    FROM tbl1;
    Attached Thumbnails Attached Thumbnails qry1.png  
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    skunkworks is offline Novice
    Windows 10 Access 2019
    Join Date
    Oct 2025
    Posts
    5
    Welshgasman the query was originally created as you showed. It was changed to see if that would make a difference. The query works fine in either instance, but the issue with the form persists.

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,938
    works for me
    Click image for larger version. 

Name:	image_2025-10-12_205031875.png 
Views:	23 
Size:	10.6 KB 
ID:	53331

    Suggest start again, create a new form

  8. #8
    skunkworks is offline Novice
    Windows 10 Access 2019
    Join Date
    Oct 2025
    Posts
    5
    After doing a compact and repair and creating a new form, the result is the same. Strange. Is there a workaround to accomplish the following?
    delete records in tbl1
    use saved import to append records to tbl1
    run qry 2
    run saved export (not yet created) in Excel format

  9. #9
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,563
    You could try the sql in VBA?
    I like @CJ_London can also see qry1 even after downloading the file again.

    Something screwy with your system.
    Try a repair of Office. Try an import into a new DB first perhaps?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  10. #10
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,938
    Is there a workaround to accomplish the following?
    delete records in tbl1
    use saved import to append records to tbl1
    run qry 2
    run saved export (not yet created) in Excel format
    i don't use macros, too limiting - but if you are you can edit them. so for your missing query, choose the other one, then edit the macro
    I don't see a saved import, but that would be an append query, not an update query (per your qry2?) - again use the wizard to create the macro
    same for your qry2
    Don't know what you mean by 'saved export in excel format' - but check out how you might do this with the macro builder

    Or you can do it with one click using vba

    currentdb.execute "name of query1"
    currentdb.execute "name of query2"
    currentdb.execute "name of query3"

  11. #11
    skunkworks is offline Novice
    Windows 10 Access 2019
    Join Date
    Oct 2025
    Posts
    5
    VBA is above my pay grade, but I'll try the macro approach. Thank you!

    Thanks to everyone who contributed!

  12. #12
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,563
    Quote Originally Posted by skunkworks View Post
    VBA is above my pay grade, but I'll try the macro approach. Thank you!

    Thanks to everyone who contributed!
    Well, give yourself a rise.
    It will serve you much better in the future. You now have ChatGPT and the like. You can Google and use YouTube.
    Plenty of help out there. You just have to use it.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 11
    Last Post: 02-09-2016, 07:45 AM
  2. Replies: 22
    Last Post: 09-23-2015, 09:01 PM
  3. Replies: 3
    Last Post: 06-03-2015, 10:16 AM
  4. Replies: 3
    Last Post: 08-04-2013, 07:11 AM
  5. Replies: 1
    Last Post: 07-27-2010, 02:27 PM

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