Results 1 to 5 of 5
  1. #1
    noaccessguru is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    Melbourne, Australia
    Posts
    68

    Easy One (for most)....Code for 'Save Record then Open Table'.....

    Hi guys,



    Not great with writing code (but Im learning.....slowly)

    I know this is a real easy one, but I jsut can't get it right!

    Can someone please tell me how I basically write the code for it to say: 'SaveRecord THEN Open Table'

    Im putting this to an 'On Click' Event for a Command Button.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Why do you need to open table? Are you building this db for other users? Users should not work directly with tables and queries, only forms and reports.
    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
    noaccessguru is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    Melbourne, Australia
    Posts
    68
    Oops I meant open Report!

    Basically they are filling in some data then pushing a button to open the report, but its not updating the fields in the report unless I save first.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Record is committed to table when close form, move to another record, or run code. So like:

    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.OpenReport "report 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.

  5. #5
    noaccessguru is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    Melbourne, Australia
    Posts
    68
    Excellent, exactly what I needed! Works a treat.

    Thanks June7!

    (I will be a star at code one day...)

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

Similar Threads

  1. Replies: 6
    Last Post: 11-13-2012, 04:29 PM
  2. Replies: 1
    Last Post: 05-03-2012, 02:25 PM
  3. Replies: 7
    Last Post: 11-23-2011, 08:14 PM
  4. save record in 2 table
    By smahdih in forum Forms
    Replies: 2
    Last Post: 11-13-2011, 12:51 AM
  5. save last record in table through a form
    By ajetrumpet in forum Forms
    Replies: 3
    Last Post: 09-09-2010, 08:53 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