[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Can't Stop a Loop - Microsoft Access

Posted on 2009-12-27
2
Medium Priority
?
416 Views
Last Modified: 2012-05-08
I'm pretty much learning Access as I go and was wondering if any one could help he with a do until loop.

I am updating a field by pasting a new value in it. Everything works fine until I can't get it to recoginize that it ia at the last recod. It just keeps looping forever. Any ideas on how to stop this loop?

Do
DoCmd.RunCommand acCmdRecordsGoToNext
DoCmd.RunCommand acCmdPaste
Loop Until ? " I want it to stop at the last record. I tried if the field = Null but keeps going"

Thanks

0
Comment
Question by:NuclearOil
2 Comments
 
LVL 28

Accepted Solution

by:
TextReport earned 2000 total points
ID: 26127951
You should be running an update query rather than trying to programatically simulate what you would do via the keyboard. The SQL of the Update would be something like: UPDATE MyTable SET MyField = 'xyz' WHERE ID = 123

You can create the UPDATE Query in the query design

Cheers, Andrew
0
 

Author Closing Comment

by:NuclearOil
ID: 31670210
That worked perfectly.

Happy Holidays
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question