Results 1 to 2 of 2
  1. #1
    PBCN is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2016
    Posts
    24

    Open Last Record

    So here's the issue I having. Im using Access linked to Azure and I'm using the ID from the record to create a folder as soon as I start entering the details to save the quote that will be created, But because I am using Azure the ID field isnt populated until I save, close and reopen the record. So at the moment Im having to create the new record, save and close, then go to my list of records and open the last created record so that the ID field is populated and then continue on from there.


    My thought on solving this, is to create code much like this below, but I dont know how to tell the last line to open to the last record.
    DoCmd.OpenForm "QuotesF", acNormal, , , acFormAdd, acWindowNormal
    DoCmd.Close acForm, "Quotesf", acSaveYes
    DoCmd.OpenForm "Quotesf", acNormal, , , acFormEdit, acWindowNormal

    Can somebody let me know what I need to add or if there is another way of populating the ID field without save and closing the form?

    P.S I have seen some runcommands to open to the last record when opening the form but I dont want that to run every time as I want to be able to click and open specific records from a list.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    take a look at this post

    http://stackoverflow.com/questions/4...f-inserted-row

    so your routine could be along the lines of

    enter data
    save record
    get @@identity
    create folder
    close form/go to new record

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

Similar Threads

  1. Replies: 10
    Last Post: 12-17-2014, 03:31 PM
  2. Replies: 4
    Last Post: 12-16-2014, 05:08 PM
  3. Replies: 3
    Last Post: 11-01-2013, 10:16 AM
  4. Replies: 2
    Last Post: 03-13-2013, 06:13 PM
  5. Replies: 3
    Last Post: 08-26-2012, 10:04 PM

Tags for this Thread

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