Forum Discussion
Bill_Sterner
Jun 20, 2023Copper Contributor
Using gotoRecord,,acFirst and gotoRecord,,acnext
I am trying to run a "batch" type function by using "gotoRecord,,acFirst," and later after some other processing using "gotoRecord,,acNext" to get to the next record in the table, but the logic does ...
Bill_Sterner
Jun 22, 2023Copper Contributor
Note the first instruction after the DO UNTIL. I run with debug and displayed the SH_RecordKey field which displayed the key to the first record only each time. The logic did recognize the EOF condition and reacted correctly.
George_Hepworth
Jun 22, 2023Silver Contributor
I think you might get the result you want if you use the value of SH_RecordKey from the recordset, rather than from the form's bound recordsource.
RecKey = SK5_RecSet!SH_RecordKey
RecKey = SK5_RecSet!SH_RecordKey
- Bill_SternerJun 22, 2023Copper ContributorYes, that worked. I will try to use the RecordSet with the full version and see what happens.
Thanks for all your help. BTW, where do you reside in our country?- George_HepworthJun 22, 2023Silver ContributorFirst, I did drag you through some trouble-shooting steps because I think we learn more that way than having someone supply an unexplained answer. My hope is that you learned more about recordsets and how to use them in VBA that will benefit future work as well as the current problem.
I am near Bellevue, Washington.