• 0

[VBA] Moving through record set problem


Question

I've got a small VBA app that needs to move through records in a table from an access database, and display them in textboxes.

When I move to the next record I have the following code setup to do so:

'The Next Button:
With MyRecordSet
.MoveNext
If .EOF = True Then
.MoveLast
End If
End With
LoadTextBoxes

The above works when I move from the first entry to the second entry. However if I attempt to move from the second entry to the third entry, it won't work. It loads the second entry again.

There are currently 10 records in the table its getting data from.

Any ideas on how I can get it moving from the current record to the next?

Thanks :)

3 answers to this question

Recommended Posts

  • 0
You're not iterating over the recordset:

With MyRecordSet
Do While Not .EOF
	'Load into appropriate textbox here
	.MoveNext
Loop
.Close
End With

Thanks Antaris,

I thought it might have do with the way my loop was setup, just couldn't put my finger on it.

However, when I attempt your suggestion it goes from the first record, to the last record. hmm..

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • memories! completely forgot about alcohol 120%!!!! man this list just makes me think of all the exciting times! everything's become so sterilized these days. 
    • Salesforce to acquire Fin, formerly Intercom, for over $3 billion by David Uzondu Image via DepositPhotos.com Salesforce today announced that it has reached an agreement with customer support software company Fin to buy the company for around $3.6 billion. Salesforce expects the transaction to close in the fourth quarter of its fiscal year 2027, and the acquisition will not change its financial guidance previously announced on May 27. Marc Benioff, CEO of Salesforce, in its press release, claimed that acquiring the startup gives Salesforce an immediate AI agent that resolves support tickets across email, WhatsApp, SMS, and Slack: You might know Fin by its former name, Intercom. If you have ever been on a website or inside a mobile app and noticed a little chat bubble widget floating in the bottom right corner of your screen, often featuring a friendly face and a message like, "Hi! How can we help you today?" you were almost certainly looking at Intercom. Intercom became Fin just last month, transforming itself into an "AI-first" platform that handles customer issues with little need for humans to intervene. The new name originates from the company's highly successful AI customer service agent, which it launched way back in 2023. This digital assistant supposedly resolves about 76% of customer service volume end-to-end on its own, so the business rebranded to match its primary software tool. Fin's new owners, Salesforce, went on an acquisition spree over the last few years, and some of them you might recognize, like its 2020 $27.7 Billion acquisition of Slack. The last few months saw the enterprise giant buy several startups, including m3ter, Momentum, Cimulate, and Contentful. Salesforce said that when the Fin deal pulls through, customers will "deploy AI agents across" various service operations, which will complement Agentforce, the platform that enables businesses to deploy customizable autonomous digital workers.
  • Recent Achievements

    • One Year In
      ThatGuyOnline earned a badge
      One Year In
    • Week One Done
      Jeroen Wilms earned a badge
      Week One Done
    • Week One Done
      rolfus earned a badge
      Week One Done
    • One Month Later
      Leroy Jethro Gibbs earned a badge
      One Month Later
    • Conversation Starter
      flexorcist earned a badge
      Conversation Starter
  • Popular Contributors

    1. 1
      +primortal
      504
    2. 2
      +Edouard
      201
    3. 3
      PsYcHoKiLLa
      127
    4. 4
      Steven P.
      82
    5. 5
      ATLien_0
      76
  • Tell a friend

    Love Neowin? Tell a friend!