Re: Using DAO to move to the new record
From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 08/22/04
- Next message: Allen Browne: "Re: Saving records from a from with multi-select listbox"
- Previous message: workinghard_at_news.postalias: "Re: Cascading comboboxes on a continuous Form issue"
- In reply to: John S. Ford, MD: "Using DAO to move to the new record"
- Next in thread: Albert D. Kallal: "Re: Using DAO to move to the new record"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Allen Browne: "Re: Saving records from a from with multi-select listbox"
- Previous message: workinghard_at_news.postalias: "Re: Cascading comboboxes on a continuous Form issue"
- In reply to: John S. Ford, MD: "Using DAO to move to the new record"
- Next in thread: Albert D. Kallal: "Re: Using DAO to move to the new record"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|