Results 1 to 6 of 6
  1. #1
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199

    How to setup this concept in tables

    Hello,



    I'm a brand new Access user and I have a project that I'd like to try in Access. Basically I'm trying to create a database where I can report across these fields. I'll be entering produdct details in for each:

    1. Name of food
    a. Vitamin components
    b. recommended dossage
    c. Heals what ailments

    What's the best way to organize this information in an Access db that will allow me to create output based on whatever input I choose; for instance foods with X vitamin components and their dossage. Or query for ailments, etc

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    tblFoods
    FoodID FoodName ----> other food fields

    FoodID would be an autonumber

    tblVitamins
    VitID VitName ----> other vitamin fields

    VitID would be an autonumber
    VitName would be the name of the vitamin

    tblAilments
    AilID AilName ---> other ailment fields

    AilID would be an autonumber
    AilName would be the name of the ailment

    tblFoodVitamins
    FVID FoodID VitID Dosage

    FVID would be an autonumber
    FoodID would be the foreign key from tblFood
    VitID would be the vitamin found in that food (many vitamins per food)
    Dosage would be the amount of that vitamin found in the food.

    if the food is supposed to heal an ailment you would have

    tblFoodAil
    FAID FoodID AilID

    FAID would be an autonumber
    FoodID would be the foreign key from tblFood
    AilID would be the foreign key from the ailments table

    If the vitiamin is supposed to heal an ailment you'd have

    tblVitAil
    VAID FoodID VitID

    the same sort of set up.

  3. #3
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    rpeare: Thank you. I very much appreciate your reply.

    I'm trying with the build-out that you suggested.

  4. #4
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    rpeare a follow up question:

    How should I handle the ingredients field? In fact foods have multiple ingredients? Do I make an Igredient 1, Ingredient 2, etc?

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Yes then you'd have an ingredient table which would be related to the FOOD table through the FOODID though... it leads me to wonder if you're going to have foods that are also ingredients (eggs for instance) you will likely want foods and ingredients on the same table with a simple yes/no checkbox to indicate ingredient vs. final food then you could keep them all on the FOOD table

  6. #6
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    Thanks, good points. I'm interested in looking at the nutritional properties of each substance more than the final product. Ingredient is really the wrong word - probably vitamin or nutrient is better. So In that case I think that I need to have 2 tables as you suggested.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Mltiple Group By concept?
    By cory.plowman in forum Access
    Replies: 4
    Last Post: 08-24-2011, 04:34 PM
  2. Contract letter concept
    By siktir23 in forum Access
    Replies: 3
    Last Post: 07-22-2011, 12:07 PM
  3. Report Concept
    By BLD21 in forum Reports
    Replies: 1
    Last Post: 07-03-2011, 09:44 AM
  4. Concept Forms
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-31-2010, 01:51 AM
  5. Page setup in both tables and queries
    By chum in forum Queries
    Replies: 1
    Last Post: 02-26-2010, 02:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums