Results 1 to 4 of 4
  1. #1
    Icewolf0927 is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    13

    Creating Multipule records

    Hi





    I am pretty sure I wont be able to do what I want to do but I thought I would ask. I have a field that hold the number of transactions. I was wondering is there a way to take that number and create a record for each transaction. If the field has 300 in it then it would need to create 300 rows.

    Thanks
    Andy

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    what do you need to put in the 300 rows?

  3. #3
    Icewolf0927 is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    13
    There doesn't have to be any special information in there. See the problem is the database I am getting the information from doesn't have all the information. In a perfect world the analyst would enter the SSN in but they aren't doing that all they are doing is enters the number of SSN they added. We don't have an easy way of getting the SSN.

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Following code copy record from table1(you table with transction number) to table2, you need to create table2 before run the code. if your field name is not "numberOfTransaction", please change the code.
    Code:
    Public Sub a()
        Dim i As Long
        CurrentDb.Execute "delete * from table2"
        i = DMax("NumberOfTransaction", "table1")
        For i = i To 1 Step -1
            CurrentDb.Execute "insert into table2 select * from table1 where NumberOfTransaction>=" & i
        Next
    End Sub

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

Similar Threads

  1. creating records from integer range in a form
    By archzealot in forum Forms
    Replies: 8
    Last Post: 04-05-2010, 12:45 AM
  2. Replies: 0
    Last Post: 10-23-2008, 12:08 AM
  3. Creating top values with two records
    By avesamuel in forum Queries
    Replies: 0
    Last Post: 10-15-2007, 10:45 PM
  4. Replies: 1
    Last Post: 12-06-2006, 05:32 PM
  5. Creating a string from all records in a table
    By ocordero in forum Programming
    Replies: 2
    Last Post: 08-07-2006, 09:21 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