Results 1 to 2 of 2
  1. #1
    Magnus1982 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2017
    Posts
    29

    How to do befour update only once in the loop

    Hi ,



    This is my small problem.

    I have control name ctInput (bounded with table). In this field I am typing or scanning number e.g. KKK0001.
    After update is a loop which:
    1. Splitting KKK0001 to other controls ctCp1 for KKK and ctCp2 for 0001 ,
    2. Adding 1 to ctCp2 (and i have 0002)
    3. Joining together full number KKK0002
    4. Placing final value to ctInput.
    Loop is doing that 15 times . It is mean loop creating 15 records in tables with next numbers from KKK0001 to KKK0015

    I need to place code before update which will check that KKK001 exist in other table. I know how to do that but:

    If I am placing code before update event is checking not only once but always when loop is working .I just need to do that once for first number which I am typing or scanning not for numbers from loop.

    Thanks for help

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What does your code look like? The check should be able to be placed before the loop so it only executes once.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. loop recordset and update fields
    By gammaman in forum Programming
    Replies: 9
    Last Post: 06-30-2016, 04:20 AM
  2. Replies: 6
    Last Post: 11-05-2014, 05:27 PM
  3. Update table from vba on loop
    By twmr2000 in forum Access
    Replies: 4
    Last Post: 10-24-2013, 12:04 PM
  4. Replies: 1
    Last Post: 05-17-2013, 08:35 AM
  5. How to update subform records using loop
    By tahirsatti in forum Forms
    Replies: 15
    Last Post: 05-13-2013, 01:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums