Re: Using DAO to move to the new record

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 08/22/04


Date: Sun, 22 Aug 2004 17:08:40 +0800

The new record row in the form does not have an equivalent in the
RecordsetClone of the form, so you cannot use that approach.

If the form is at a new record, attempting to reference the form's Bookmark
*should* produce an error. It does if the user has not begun entering
something. If an entry has been started, Access wrongly reports the bookmark
of the most recent entry you visited. (This bug has been present since at
least version 2 of Access, and AFAIK is still not fixed.)

So, make sure the form has focus, and use:
    RunCommand acCmdRecordsGotoNew
AFAIK, there is no way to make a form go to the new record if it does not
have focus.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"John S. Ford, MD" <johnsfordNOSPAMmd@hotmail.com> wrote in message
news:%235vkLCBiEHA.2764@TK2MSFTNGP11.phx.gbl...
> I'm trying to write some code that will move the cursor to the new record.
> I've tried the following:
>
>        Dim rst As Recordset
>        Set rst = Me.RecordsetClone
>        rst.MoveLast
>        Me.Bookmark = rst.Bookmark
>
> Unfortunately, this moves the cursor to the last "completed" record, not 
> the
> new one.  I've also tried
>
>        rst.AddNew
>
> which doesn't work either.
>
> Any ideas?
>
> John 


Relevant Pages

  • Re: Using DAO to move to the new record
    ... If an entry has been started, ... AFAIK, there is no way to make a form go to the new record if it does not ... "John S. Ford, ... > I'm trying to write some code that will move the cursor to the new record. ...
    (microsoft.public.access.gettingstarted)
  • Re: Using DAO to move to the new record
    ... If an entry has been started, ... AFAIK, there is no way to make a form go to the new record if it does not ... "John S. Ford, ... > I'm trying to write some code that will move the cursor to the new record. ...
    (microsoft.public.access.forms)
  • Re: I Cant Believe Its Not Heinlein
    ... Weightless_ to make the cut. ... The Heinleinesque List (not all strictly Heinlein inspired, but that was the entry point): ... John M. - GROWING UP WEIGHTLESS ... Gerrold, David - BOUNCING OFF THE MOON, JUMPING OFF THE PLANET, LEAPING TO THE STARS ...
    (rec.arts.sf.written)
  • Re: Copy Changing Dates
    ... Hi John, ... This will start up the Registry Editor and will allow you to edit the ... > If your system has this entry already listed, ... > Windows Registry Editor Version 5.00 ...
    (microsoft.public.windowsxp.general)
  • Re: How many names and addresses can you have for ID card
    ... An entry may have any number of atrributes which are ... so in essence the design is there. ... cn: john smith ...
    (uk.legal)