Append in table 2 for each record in table 1

brickelldb

Registered User.
Local time
Today, 03:22
Joined
Mar 9, 2009
Messages
70
Kind of stumped on this. Searching "append for each" just kind of throws me into standard quering articles. Any help would be greatly appreciated.

Table 1_Customer: ID, First, Last (2 records)
Table 2_Transaction: ID, CustomerID, Date, Amount

What I'm trying to do is create an append query that will insert a record into Table 2 for each record in Table 1.

Ex: My form has 2 fields: Date, Amount.

I want the append query to append 2 records into Table 2. 1 record for the 1st record of Table 1 and 1 record for the 2nd record of Table 1. But obviously would like for it to do it for EACH record in Table 1, regardless of how many records in Table 1. And where the ID from the record in Table 1 is in inserted in the CustomerID field of Table 2.
 
Create a SELECT query that returns the records from table 1, then turn it into an append query. It will ask you for the target table, and you may have to adjust the destination fields if they're not the same.
 
Interesting. I did not think about that. Let me give that a shot. Thanks for the response.
 
Create a SELECT query that returns the records from table 1, then turn it into an append query. It will ask you for the target table, and you may have to adjust the destination fields if they're not the same.

I would say it is better you casted the data from the source tables, useing Cstr(), Clng() etc. functions. Use the Expression Builder and the help offered there.
 
I would say it is better you casted the data from the source tables, useing Cstr(), Clng() etc. functions. Use the Expression Builder and the help offered there.
But how would CStr() and CLng() handle null values?
 

Users who are viewing this thread

Back
Top Bottom