Results 1 to 5 of 5
  1. #1
    November is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    2

    Extremely Basic Question

    Hi all,

    Very new to access, and I am stuck.

    lBasically what I am trying to create is a simple diet tracking database that lets me create a daily meal plan.

    So I have one table with all the foods and their various nutrients

    Then I have a table of each day that I can populate from the food table.



    My problem is when I create a lookup field for the Day table, I can only get the food name displayed. I can't really seperate all the other values in the to perform totals calculations.

    Am I going about this all wrong?

    Any help appreciated.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    you have a tFood table, and you will need a tMeal table.
    tMeal table has multiple items from tFood. Are you using an ID in tFood? or the Food name?

    tMeal DOES need an ID
    [id], [MealName]
    1, Veggie plate
    2, Fried Chicken

    but you also need the item list of the tMeal, say tMealItems
    this holds all the foods in the meal.
    tMealItems
    [id],[Food]
    1, green beans
    1, cauliflower
    1, hummus
    2, chicken
    2, green beans

    this tMealItems MUST be put in the realtionship with tMeal.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,935
    suggest you may also need a table for nutrients and another to link to the foods

    tblNutrients
    NutrientPK autonumber
    NutrientName text
    Info text benefits of this nutrient

    1..vitaminA......good for
    2..vitaminB......good for
    3..Fat..............bad for
    4..sugar...........bad for


    tblMealNutrients
    MNPK autonumber
    MealFK long - link to meal table
    NutrientFK long - link to nutrient table
    qty double - quantity per 100g

    1..12...1...0.2
    2..12...3...0.1
    2..12...4...4.5

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    My problem is when I create a lookup field for the Day table,.......
    I have NEVER and will NEVER use a look up field in a table. This should be done in a combo box on a form.

  5. #5
    November is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    2
    Hi all,

    Hmm I am getting more stuck!!!!

    So maybe I am going about it the wrong way.

    I am trying to create something where I can add meals/foods to a day, which will automatically calculate the totals of those nutrients for that day. E.G Monday Bread Protein 10g Fat 25g Carb 30g

    So The tables I have are

    tMeals - This includes a description of the food and the nutrients
    tDay - This is what day the meals will be added on

    Where I am getting stuck is trying to put these in a form, but when I select a Meal, how do I get it to populate the rest of the nutrient fields e.g proten/cabs/fats?

    Any help appreciated!
    Last edited by November; 09-20-2016 at 11:58 PM.

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

Similar Threads

  1. Basic Question
    By poppet in forum Access
    Replies: 9
    Last Post: 07-24-2014, 05:41 AM
  2. basic (sorry) question
    By wokeeffe in forum Database Design
    Replies: 1
    Last Post: 12-21-2010, 11:20 AM
  3. Basic Question
    By Dalagrath in forum Forms
    Replies: 12
    Last Post: 10-31-2010, 05:36 AM
  4. Really basic question
    By jimlaw in forum Forms
    Replies: 1
    Last Post: 07-27-2009, 07:20 AM
  5. Basic Question
    By chris11590 in forum Forms
    Replies: 0
    Last Post: 08-04-2008, 05:57 AM

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