PC Review


Reply
Thread Tools Rate Thread

Addnew followed by Edit

 
 
MIG
Guest
Posts: n/a
 
      26th Jul 2010
I am using a DAO recordset to add a new record if fields don't match,
but to edit other fields if fields do match (using source data that's
sorted, so that all source records relating to the one record I am
adding to a different recordset are bunched together).

Basically, if I do an Addnew and subsequently do an Edit, will the
record I've just added always be my current record if don't do
anything else to move records, or do I need to find the record I've
just added?

Thanks.
 
Reply With Quote
 
 
 
 
ManningFan
Guest
Posts: n/a
 
      26th Jul 2010
After an Update statement, the table will reset itself. This means,
the Edit function will then start at the first row in the table and
edit that row. You will need to set a cursor or reset the recordset
to just the record you want to edit by using a WHERE clause in the
SELECT statement of the recordset.
 
Reply With Quote
 
MIG
Guest
Posts: n/a
 
      27th Jul 2010
On 26 July, 19:00, ManningFan <manning...@gmail.com> wrote:
> After an Update statement, the table will reset itself. *This means,
> the Edit function will then start at the first row in the table and
> edit that row. *You will need to set a cursor or reset the recordset
> to just the record you want to edit by using a WHERE clause in the
> SELECT statement of the recordset.


Thanks; yes I found it not to work.

I did a seek on the table I was populating each time and that works
OK, ie if there's a no match, it adds the basic details to a new
record, but if there's a match it adds extra fields to the record it
just made. As long as the source recordset is sorted it seems to work
OK (the source has multiple records per person which I am having to
make into a flat record).
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update or CancelUpdate without AddNew or Edit AimeeK via AccessMonster.com Microsoft Access Forms 0 16th Nov 2005 12:14 AM
Edit or AddNew in a Form =?Utf-8?B?SmFtZXM=?= Microsoft Access Getting Started 2 4th Oct 2005 11:04 PM
Trouble with .AddNew and .Edit M Microsoft Access VBA Modules 4 25th May 2004 04:20 PM
DAO AddNew/Edit Methods Ronald Dodge Microsoft Access VBA Modules 4 5th Jan 2004 03:02 PM
Update or CancelUpdate without Addnew or Edit Synergy Microsoft Access Forms 1 6th Oct 2003 06:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:02 AM.