Can't Stop a Loop - Microsoft Access

Posted on 2009-12-27
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?

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"


Question by:NuclearOil
    LVL 28

    Accepted Solution

    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

    Author Closing Comment

    That worked perfectly.

    Happy Holidays

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Suggested Solutions

    Introduction If you are not already aware of what you could use a table with sequential integer values for in SQL, you can read Delimited String Parsing in SQL Server 2005 or later ( by BrandonGalderisi (h…
    Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    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…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now