Results 1 to 8 of 8
  1. #1
    WAVP375 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Dayton Ohio
    Posts
    171

    Go to next recoed


    I am looping through a table from I=0 to I=Me.Recordset.RecordCount
    I have attempted several different GoTo next record commands and non of them will take me farther than 141 records.
    There must be a command that will get me through several hundred records.

    Any thoughts?
    Thanks

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    ?? How many records are in the recordset?
    Check it separately to make sure there is an issue.
    A little more info about the context would be helpful to focus a response.

    If you just open the table in datasheet view don't you get a record count?

  3. #3
    WAVP375 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Dayton Ohio
    Posts
    171
    Table contains 281 records. Code is
    Dim I As Integer
    Dim LastOne As Integer
    I=0
    LastOne = Me.Recordset.RecordCount

    For I = 0 To LastOne
    If Assignment = "Fro" Then
    JobNumber = 1008
    .
    .
    .
    DoCmd.RunCommand acCmdSaveRecord
    End If
    DoCmd.GoToRecord, , acNext
    I = I + 1
    Next I

    All works well but only for 141 records.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    But how many of the 281 have
    Code:
    Assignment = "Fro"
    Are you only counting those with this criteria???

  5. #5
    WAVP375 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Dayton Ohio
    Posts
    171
    Unknown how many "Fro" is in the file. I am looking for other similar content and making a similar updates. The only counting is the total number of records in the Recordset.
    Read a record, Check criteria, make a change and save the record. But check every record in the recordset. Each record will have some kind of change made.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725

  7. #7
    WAVP375 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Dayton Ohio
    Posts
    171
    I am working with a test DB. Only a form with the code shown in post #3 with several more If statements, and the table.
    The table has 4 fields Numeric 'Badge', Text 'Assignment', Numeric 'AssignmentCode' and Numeric 'JobNumber'
    I'm looking at the text and generating a number.

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums