Re: How walk recset in DAO, do AddNew & return to CurRec B4 AddNew?



Oops. Oops. Oops. My bad.

Had an extra .MoveNext in there that was unaccounted
for. More bad programming on my part. Sorry about that.
After taking it out and organizing my code more legibly,
I found that the A97 HELP stmt was correct. The rec that
was current before DOES remain current. So sorry.

Something I did not realize caused me further confusion.
I did not understand that using AddNew in a DAO procedure
would increase the number of records in your recordset as
well as appending a record to the underlying table. Basically,
I was walking the recordset looking for records whose [Field1]
value was "x". When I found one, I was appending an identical
record to the underlying table, but making the [Field1] value "y".
This not only added a record to the underlying table, it added
one dynamically to the recordset. Since I was looping to EOF -
I never got there and had to CTRL-ALT-DEL and end the
process. I ended up having to do away with the Do Until - Loop
and go with a For i=1 to .RecordCount approach. What would
some of you recommend in that situation?
.



Relevant Pages

  • Re: parameter
    ... Oops. ... Nevermind. ... recordset, looks up the row based on the Album ID, checks each of the ...
    (microsoft.public.access.queries)
  • Re: select statement sql
    ... Oops - you're right Jeff ... >> Just be careful when there's a space in the field name, ... > Again, this has nothing to do with the RECORDSET, only the SQL statement ...
    (microsoft.public.vb.general.discussion)
  • Re: Using LIKE in SQL (Repost, still need help)
    ... nevermind. ... >oops, ... But when I run the query in the SQL ... >Any idea why my recordset is blank? ...
    (microsoft.public.access.modulesdaovba)
  • Re: Database Structure Question ... Serious Help Only Pls
    ... Maybe simply appending with a query won't work... ... The only problem you might have is determining the primary key ... On your recordset object after you have updated the recordset issue a ... it, and append the parent table data, grab the PK as above and store it ...
    (comp.databases.ms-access)
  • Re: Query criteria
    ... Or if your field can contain nulls, you can force a value in it by appending ... a zero length string and using the first option ... value from the form is "1" a specific recordset is returned and if the ...
    (microsoft.public.access.queries)