Solved

Create a New Table Automatically in a Database

Posted on 2014-01-13
3
254 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 34

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

863 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

21 Experts available now in Live!

Get 1:1 Help Now