Results 1 to 6 of 6

Thread: .EOF and adding records

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Location
    Shawnee Mission, KS
    Posts
    14

    Post

    Kent, it seems to me in Access that you have to enter some data in the new record before it is considered a record. If it is blank it doesn't give you a new record or EOF as the new record. Hope this helps.

    MillerD

  2. #2
    New Member
    Join Date
    Feb 1999
    Location
    Palmdale, CA US
    Posts
    14

    Post

    Mildumar, thanks for the reply!
    In fact I do. After the new record is created, I write data to the fields, perform an update (which I verify appears in the db from access) and then do a movenext. I expect at this point to be once again after the last record, but the new record remains the current one! A second .movenext gets me to the end.

  3. #3
    New Member
    Join Date
    Feb 1999
    Location
    Palmdale, CA US
    Posts
    14

    Post

    I have been pulling my hair out over a seemingly simple thing: i am overwriting records in an existing database. each time I do a .movenext I check the .EOF flag to see if I've run out of existing records. If so then I add a record to the recordset, the .eof flag clears, and I write the data and do an update. So far so good - if I do a .movenext after adding, I should get another .eof = TRUE, right? Wrong! The new record stubbornly remains the current record, and .eof=False. It takes a 2nd .movenext for the .eof to set. Can anyone explain this behavior?

    (btw, it's vb6 pro, Acccess97 via Jet 3.51)

    thanks!

  4. #4
    Junior Member
    Join Date
    Jun 1999
    Location
    Papillion, NE, USA
    Posts
    21

    Post

    This is because of the Access behavior is to go back to the record that was current before the AddNew command.

    If you use the LastModified property you can get to the new record --- but the most surefire way to ensure that you are on the last record in the dataset is to use the Movelast command.



  5. #5
    New Member
    Join Date
    Feb 1999
    Location
    Palmdale, CA US
    Posts
    14

    Post

    Thanks, Jim! It seems kind of weird, but it seems correctly predict the behavior. BTW, is this an Access thing, or a Jet thing???

  6. #6
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Jet

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width