Solved

Create a New Table Automatically in a Database

Posted on 2014-01-13
3
257 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 36

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

820 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