Results 1 to 3 of 3
  1. #1
    Rafegh is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Posts
    13

    Looping in data macros???

    Is it possible to have a loop on a data macro? Think that in one table I insert number 5, can access make exactly five records in another table?


  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Looping in a macro is not easy - maybe impossible with Data Macro.

    Bing: Access macro loop
    http://support.microsoft.com/kb/90815
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    This would be done with an Append Query; you would need a control table that consists of only integers in sequence beginning with 1 and continuing to the highest number you app will ever require. Then you build it by applying the criteria of <=5 to a Select Query against your control Table which will result in 5 records. Then you join that to your data - and then write it into the table using the Append Query.

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

Similar Threads

  1. Macros for a web database data entry form
    By Twinnie in forum Access
    Replies: 13
    Last Post: 05-29-2014, 01:33 PM
  2. Macros, VBA, Autopopulation of Data
    By pdevito3 in forum Access
    Replies: 5
    Last Post: 08-13-2013, 01:39 PM
  3. Looping
    By ddrew in forum Forms
    Replies: 8
    Last Post: 10-08-2012, 01:48 AM
  4. Import excel sheet data into Ms-access using VBA macros
    By gokul1242 in forum Import/Export Data
    Replies: 2
    Last Post: 10-02-2012, 04:39 AM
  5. Confusion with Data Macros and SetField
    By Datech in forum Access
    Replies: 3
    Last Post: 04-06-2012, 11:59 PM

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