Multiple entries in a table

  • Thread starter Thread starter Jenn
  • Start date Start date
J

Jenn

I have a software table and I need to add 300 of the same peace of software
in it BUT for each user. Is there a way to add the software once and then
populate for each user? Maybe a Query or something? Any thoughts would be
great.

Thanks
 
INSERT INTO YourTable ( Employee, Software )
SELECT [Employee_List].[Employee], "Software_Title" AS Expr1
FROM [Employee_List];

You can add WHERE also if some employees have terminated.
 
Do you have a table that contains the users?

If so, you can use it to populate the software table.

INSERT INTO [Software table] ([USERID],[SoftwareNameField])
SELECT [UserID], "Microsoft Access 2007" as SWName
FROM [Table of Users]

In Query Design view
== Add your user table
== Put the UserID field in the list of fields
== Type the name of the software (or the id number) into a new field, for
instance:
"Microsoft Access 2007"
== Select Query: Append Query from the menu
== Select your table that you want to add records to
== In the Append to row select the field to insert the values into


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
I'm sorry, but i'm not sure what you mean by: INSERT INTO [Software table]
([USERID],[SoftwareNameField])
SELECT [UserID], "Microsoft Access 2007" as SWName
FROM [Table of Users]

What do i insert that into? The table or the query?

John Spencer said:
Do you have a table that contains the users?

If so, you can use it to populate the software table.

INSERT INTO [Software table] ([USERID],[SoftwareNameField])
SELECT [UserID], "Microsoft Access 2007" as SWName
FROM [Table of Users]

In Query Design view
== Add your user table
== Put the UserID field in the list of fields
== Type the name of the software (or the id number) into a new field, for
instance:
"Microsoft Access 2007"
== Select Query: Append Query from the menu
== Select your table that you want to add records to
== In the Append to row select the field to insert the values into


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I have a software table and I need to add 300 of the same peace of software
in it BUT for each user. Is there a way to add the software once and then
populate for each user? Maybe a Query or something? Any thoughts would be
great.

Thanks
 
I am having trouble with this. I am not understanding step 2. Can you
please explain it a little bit? Thanks
 
That is the SQL statement of a query. It is what would be generated by query
design view when you build an append query. When you Run the query, (menu
Query: Run) it will append (add) records to your table.

IF you don't know how to use the SQL window to build a query then did you try
to follow the steps outlined for working in Query Design View.

WARNING: Backup your data BEFORE you attempt to run the query. If this
doesn't work as expected there is no way to undo it, other than to find the
new records that you have added and delete them.

In Query Design view
== Open a new query
== Add your user table
== Put the UserID field in the list of fields
== Type the name of the software (or the id number) into a new field, for
instance:
"Microsoft Access 2007"
== Select Query: Append Query from the menu
== Select your table that you want to add records to
== In the Append to row select the field to insert the values into
== Select Query: Run from the menu



John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Jenn said:
I'm sorry, but i'm not sure what you mean by: INSERT INTO [Software table]
([USERID],[SoftwareNameField])
SELECT [UserID], "Microsoft Access 2007" as SWName
FROM [Table of Users]

What do i insert that into? The table or the query?
 
Back
Top