Results 1 to 3 of 3
  1. #1
    shelzmike is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2010
    Posts
    22

    [Unconventional] Save form then run query

    I have a command button on a form that I want to do 2 things when clicked:

    #1 - Save the FORM (as if you right-click and choose Save), then


    #2 - Run a query.

    I know it is unconventional to save the form in this manner, but I need to be able to do this for a particular implementation. Thanks!

    Mike

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    By save FORM, you mean save the record?

    DoCmd.RunCommand acCmdSaveRecord

    DoCmd.RunQuery "query name"
    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
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by shelzmike View Post
    I have a command button on a form that I want to do 2 things when clicked:

    #1 - Save the FORM (as if you right-click and choose Save), then
    #2 - Run a query.

    I know it is unconventional to save the form in this manner, but I need to be able to do this for a particular implementation. Thanks!

    Mike
    What you are describing doesn't match with reality. Right-clicking and choosing SAVE does NOTHING about the record. It saves DESIGN CHANGES to the form.

    What June7 has given would save the record and then run the query which may be what you are after and may not, depending on whether you knew what I said about the SAVE when you posted the question.

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

Similar Threads

  1. Save form as PDF
    By rosaj in forum Programming
    Replies: 6
    Last Post: 08-22-2011, 06:06 AM
  2. Replies: 1
    Last Post: 07-18-2011, 03:08 AM
  3. Save a Query as a database ?
    By mrkaye in forum Access
    Replies: 1
    Last Post: 05-03-2011, 03:02 PM
  4. Replies: 9
    Last Post: 01-20-2011, 02:22 PM
  5. Save and New Form
    By Bakar in forum Forms
    Replies: 1
    Last Post: 12-20-2010, 04:50 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