creating a set of records

maxmangion

AWF VIP
Local time
Today, 12:06
Joined
Feb 26, 2003
Messages
2,805
I have a database in which i keep track of my books collection. Amongst my tables i three of them are:

tblBooks - main books table
tblKeywords - where i store keywords (such as "database", "programming", "web development" etc)
tblBooksKeywords - to create a many-to-many relationship between the above two tables.

Now in tblbooks i have about 270 records (1 per book). Now for each book in this table i would like to create a record in the tblBooksKeywords table to add a the keyword "Computers" to each book.

i.e.

Book1 - Computers
Book2 - Computers
and so on till Book 270

Now rather than i do this manually for 270 records is there a way in which i can create these 270 records automatically ?

Thanks
 
Could you do this with dao?

pseudo code:

Open books recordset
Open books/keyword recordset
add a record in the books/keyword recordset
set the book to books!bookname
set the keyword to 'computer'
move to the next books record
loop back

Make sense?
 
:eek:

Why didn't I think of that... :o
 
thanks for the reply. when i am trying to run the sql code which you gave me i am getting the following error "Number of query values and destination fields are not the same" ... can you please tell me what i am doing wrong ?

Thank You
 

Users who are viewing this thread

Back
Top Bottom