Append Same Record (1 Viewer)

sloaner14

Registered User
I know when you see these you will think, "What are you doing?" So, I will tell you. I have to append certain records to another table multiple times. I have a field that stores the number of times the record needs to be appended. I thought that I could do it with SQL and a loop, but I can not get it. Any ideas?
 

namliam

The Mailman - AWF VIP
Create a table with only one (integer) field.
Fill it with values you are gonna need... 1 thru 1000 would seem enough

Now use that as a hash (is that the right name) join (so do not link it to anything) in you query and limit it to <= the number you need.
The record(s) you need will be multiplied by the number you entered.

Hope I wasnt clear as mud... If I was... ask away...

Seasons greetings from Amsterdam

The Mailman
 

sloaner14

Registered User
Here is what I am trying to do. I have a table called tblMailingList. It is made up of records from two tables. I can do that. Where I have a problem is, I have some customers the get multiple issues of a magazine. So this one customer's mailing address needs to be entered into tblMailingList for every issues they receive. I have no PK's in tblMailingList, it won't need them because they won't be linked to anything. I am putting the data into the table, exporting it as an Excel file, and deleting all information out of tblMailingList. This is done quarterly.

I figured that I could do something like this:

Code:
For i = 1 to rs.issues
[INDENT]Docmd.RunSQL strSQL[/INDENT]
Next
I know that's not right, but I need something like this.

Thanks.
 
Last edited:

sloaner14

Registered User
Never mind, I finally got my SQL statements right and the Loop that I need. As always, thanks for your help.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top