Solved

Create a New Table Automatically in a Database

Posted on 2014-01-13
3
253 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
Comment Utility
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
Comment Utility
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 34

Expert Comment

by:PatHartman
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
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…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now