Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    All records not being returned (2003)

    Hi All,
    I am having a problem with a select string. It should be returning several records but it only returns one. I am sure I am missing something. The recordcount is returning one record but it should be four for the example I am looking at.

    'Get Old Rev Items
    Set db = CurrentDb
    strOldRev = "select * from tblEstimateItems where [Estimate_ID] = " & "'" & Me.Text0 & "'"
    Set rsOldRev = db.OpenRecordset(strOldRev)
    Call Form_Open(blnCancel)
    MsgBox "Records = " & rsOldRev.RecordCount, vbInformation

    Thanks,
    Mark

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: All records not being returned (2003)

    RecordCount isn't accurate until you have jumped to the end of the recordset.

    Set rsOldRev = db.OpenRecordset(strOldRev, dbOpenDynaset)
    rsOldRev.MoveLast
    Call Form_Open(blnCancel)
    MsgBox "Records = " & rsOldRev.RecordCount, vbInformation

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: All records not being returned (2003)

    Hi Hans,
    Same issue I had a while back. The problem was actually in how I was doing the movenext / movefirst commands.

    Thanks for jogging my memory!

    Mark

Posting Permissions

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