Results 1 to 3 of 3
  1. #1
    jpalk is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    4

    Delete query button?

    Hello,

    I'm just wondering if someone can explain why I cannot create a button on a form to run a delete query?



    I've tried to do this, but when I am using the control wizard to create the button, it does not list any of my delete queries as options. So I'm just curious as to why this is.

    Additionally, I'm curious if I can edit the code in VBA to do it anyways?

    Thanks for your insight, I'm new to this & appreciate the help in my learning! I haven't been able to locate anything useful about this very easily.

    Jpalk

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Sure you can "edit the code in VBA to do it anyways".

    to run a query, please put following code in click event of the button
    private sub command123_click()
    docmd.runsql "queryName"
    end sub

  3. #3
    jpalk is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    4
    Cool, thanks so much!

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

Similar Threads

  1. Button on form to delete all records
    By bbylls in forum Forms
    Replies: 2
    Last Post: 12-08-2009, 12:38 PM
  2. Simple delete button on form
    By chessico in forum Forms
    Replies: 9
    Last Post: 10-15-2009, 03:14 PM
  3. Error while trying to add delete link button.
    By islandboy in forum Access
    Replies: 3
    Last Post: 09-03-2009, 09:32 AM
  4. Command button help - delete record
    By Zukster in forum Forms
    Replies: 0
    Last Post: 08-27-2009, 08:47 AM
  5. Add/Delete Button
    By ocemy in forum Forms
    Replies: 1
    Last Post: 03-29-2009, 08:08 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