-
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
-
?? 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?
-
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.
-
But how many of the 281 have
Are you only counting those with this criteria???
-
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.
-
Can you post a copy of the database? Or relevant table and related code in a zip file?
-
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.
-
Do you actually get some records updated?
Can you post a copy of the test database?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules