Results 1 to 4 of 4
  1. #1
    asmith is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    26

    VBA to Navigate form

    Hey guys,



    I think i have an easy one for you today. I have a form that has a combobox that i use to navigate / add new records to the form. I have the combo box working well now so that it adds records the way i want and requeries automatically. What i'm trying to do is add a piece of code so that after the form requeries that it navigates to the new record. I have the records indexed so that the last record using the navigation arrows at the bottom of the form is always the newly created record.

    Does anyone know the code used to navigate to the last record? Even if you had the code to navigate to any record i can find the record number using a dlookup.

    Thanks
    Andrew

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Does this work for you?

    http://www.baldyweb.com/Requery.htm

    If not, you could probably use GoToRecord with acLast.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    asmith is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    26
    Hi Paul,

    The provided example didn't work in my situation but the gotorecord worked beautifully. For others, the code is as follows:

    DoCmd.GoToRecord acDataForm, "Input Form", acLast

    Thanks
    Andrew

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Happy to help Andrew.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Navigate window to import txt
    By Macallan60 in forum Access
    Replies: 11
    Last Post: 05-13-2010, 12:30 PM
  2. Replies: 2
    Last Post: 03-25-2010, 12:11 PM
  3. Replies: 1
    Last Post: 09-19-2009, 09:37 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