Solved

Create a New Table Automatically in a Database

Posted on 2014-01-13
3
255 Views
Last Modified: 2014-01-17
Hello,

I have created a database using MS Access 2010.  Overall the database is very simple and is used to keep records of quotes that we submit to customers.  I am trying to create a way so that once a quote is approved we can then use possibly a macro that will create its own table within the database in which we can then enter the order details.  It would be ideal if the new table is created with pre-determined formatting.

Example: a quote is approved.  I click on the macro that possible copies an existing template table that has the formatting in place.  The table opens.  Our representative then enters the order list into the new table and then saves the table using a job specific number that we create internally.

Any help is greatly appreciated!

Best regards,
Luke
0
Comment
Question by:calwood28
3 Comments
 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 250 total points
ID: 39777378
Why a new table for each order?  It would be better to have an Orders table, and add a new record per order.  You probably also need a Customers table, with a one-to-many link between Customers and Orders, and maybe an Order Details table, with a one-to-many link between Orders and Order Details (like the sample Northwind database).
0
 
LVL 30

Assisted Solution

by:hnasr
hnasr earned 250 total points
ID: 39777397
Create an empty table as a template, say templateQuote:

DoCmd.RunSQL "Select * Into newTableName From templateQuote"

Think out your design, to use one table with extra flag fields.
0
 
LVL 35

Expert Comment

by:PatHartman
ID: 39777569
Access is not Excel.  Do you think Amazon creates a separate table for each order?  No.  Creating a separate table for each order would imply that you will duplicate all the forms, reports, and queries also.

When you use a relational database, you use queries to isolate data so when you want to see only the order for Sam, you use selection criteria that returns only that order to populate your forms.  You will save yourself lots of work and frustration by getting a little education or doing some self learning by watching some videos on normalization.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Data Type Mismatch in Criteria - Access 6 32
Programmer 14 48
Launch app from Access custom ribbon 8 33
object variable or with block not set 6 28
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question