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

    Recordcount while using Do Loop (AXP)

    Hello All,
    I have this code running to add records. I want to refresh the record count at the end of every loop. Does anyone know what I am doing wrong here? The counter never increments, it just stays on the original count that I perform before starting the loop.

    Do Until strCount = 7
    rstNewTme.AddNew
    rstNewTme!Date = strStar
    rstNewTme!wo_id = Me.Text490.Value
    rstNewTme!tech_id = Me.Text484.Value
    rstNewTme.Update
    strStar = DateAdd("y", 1, strStar)
    Debug.Print rstDays.RecordCount
    strCount = rstDays.RecordCount
    Loop

    Thanks,
    Mark

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Recordcount while using Do Loop (AXP)

    You probably need to do a .MoveLast before the strCount=rstDays.RecordCount so the Record Count gets updated. Record Counts in DAO are frequently wrong until you have done a .MoveLast.
    Wendell

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

    Re: Recordcount while using Do Loop (AXP)

    Thanks Wendell,
    I believe I got it licked by doing an incremental count instead of trying to count the records in the set.

    Thanks,
    Mark Santos

Posting Permissions

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