473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Table structure

1
I'm creating an access database for a bakery that tracks inventory and recipes. Right now they only sell x number of products but that can change in the future. The recipes range from 5 ingredients to 20+ and again, can change down the road.

I believe the best thing to do would be to create one table that holds all items for sale. Then create another table for each item with separate fields being ingredient 1, ingredient 2, etc. When it's time to bake the user inputs the amount and the recipe is generated into a form, saved, and inventory is debited the proper amounts.

Somehow the user needs to update the recipe and add ingredients when needed. Even adding new products whenever they create a new pastry or whatever...I believe the best way to do this would be to have the user add fields through each products' table through a user form. From what I've read though this is a bad idea to let user determine table structure. I see no way around this. Is there a better way to structure what I need? If not how do I set up a form that adds fields to a table?
Mar 6 '14 #1
2 1595
jimatqsi
1,271 Expert 1GB
lexl,
Welcome to Bytes. You'll find lots of good help here but the burden will be on you to help yourself as much as possible. If you see no way around letting users add table fields I suspect you have not spent enough time studying what others have done in Access.

You're right, users should not be adding any fields to your table. You will need to design several related tables that contain all of the needed fields up front. But you're going to have to go one step at a time. Start small, design one table and the form to maintain it. Then move on to the next one.

But before you design anything, spend time studying the example database that came with your copy of Access. All you are needing to do has already been done (in a general sense) in the sample database. It's probably called Northwind.mdb, but you may have others. Check the Microsoft website for your version of Office/Access.

Jim
Mar 6 '14 #2
GKJR
108 64KB
lexl,
Jim is right about what he said. It sounds like you have a lot to learn. I'd like to at least point you in the right direction though. I remember being in your same position and making that same mistake.

When you say your users might need to create new fields to accommodate new ingredients in a product you are mistaken. You should have a new table such as "Product Ingredients" with a reference to your "Product" table ID field (a foreign key). Then when you create a record in this table and it is linked to a Product, you can create a query that selects only the amount of records that you have in the Product Ingredients table.

I would go a step further and create a list table called "Ingredients" that lists all of the ingredients the bakery uses. You then have three tables, Products, Ingredients, and Product Ingredients. This last table represents a many-to-many relationship between Products and Ingredients. It needs to have two fields that reference these two tables, plus any additional fields such as quantity, etc.

Good Luck
Mar 6 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dariusz | last post by:
I have written a database that counts the number of times a file has been accessed, so I can then later display the results on what is "hot" and what is not. At the moment all it does is count the...
0
by: Priscilla Walther | last post by:
Hi All - I'm a newbie to the database area, but have inherited a MySQL database to manage along with my development duties. We have a very large MySQL database, and the designer of the...
0
by: QWERTY | last post by:
--------------Boundary-00=_O5I3QL80000000000000 Content-Type: Multipart/Alternative; boundary="------------Boundary-00=_O5I3LVC0000000000000" --------------Boundary-00=_O5I3LVC0000000000000...
0
by: Randall Sell | last post by:
Hello all, I am migrating a Paradox application to SQL Server. My problem is that the existing Paradox table structure is limited. Correcting it will mean a re-write of the application (Delphi...
4
by: Robert Stearns | last post by:
For testing purposes I propose to add a schema (testing, how original) and would like to copy some of my live tables to it, both structure and data. I know I could use something like dump/restore...
3
by: ChadDiesel | last post by:
Hello everyone. I need some advice on table structure for a new project I've been given. One of our customers sends us an Excel spreadsheet each week containing their order. Currently, someone...
0
by: m3rajk | last post by:
I've recently become the defacto DBA of two MSSQL databases at work because I am the only one with SQL experience. I have been asked to do some tasks with the databases but this requires and...
3
by: jc | last post by:
Hello. I want to ask about the possibility of copying both a table structure and it's contents from a SQL server table to a table within MS access. The problem cannot be solve with a permanent...
1
by: Paddy | last post by:
Dear forum, I have a database in which each table has to be present in eleven copies for back-ups/second data entry. Making a change to a table therefore appears to require copying and pasting...
3
Soniad
by: Soniad | last post by:
Hello, I want a complete table structure assign to a variable and then insert this table structure in one of column of sql table. the problem i am facing is vbscript is not interpreting html...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.