Results 1 to 12 of 12
  1. #1
    visitnag is offline Novice
    Windows 11 Access 2021
    Join Date
    Dec 2022
    Posts
    17

    beginner's problem

    Hi,

    I have the following tables:

    A master table of employees with Name and employee ID

    One table with employee IDs as rows and GIFT names as columns (10 columns)


    another table with employee ID as rows and GIFT names as columns (3 columns)

    The gift columns contain the the number of gifts got by each employee.

    I want to build a query on employee that the result should show how many gifts the employee
    got from each table. This should also move the row from the GIFTs tables and append to a new table.

    The GIFTs columns are different for each table. If they are not movable to another table at least there should
    be a column posting that the GIFTs are distributed to queried employee

    Thank you.

  2. #2
    CarlettoFed is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    273
    Sorry what does GIFT mean? and you should attach an example file, with a minimum of data replacing possibly sensitive ones, to see the structure of the database.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,645
    This is not a normalized data structure. This is like a spreadsheet. Instead of columns (fields), each gift should be a record. Why do you have two gift tables?

    Would have to add fields and if field could be Null, have to deal with that: Nz(Field1) + Nz(Field2) + ... + Nz(Field10).

    This calculated value should not be saved to table, just calculate when needed.

    Have you studied an introductory book or any tutorials on relational databases?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 11 Office 365
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    Here is a very good white paper on data structure in a RDBMS
    Attached Files Attached Files

  5. #5
    visitnag is offline Novice
    Windows 11 Access 2021
    Join Date
    Dec 2022
    Posts
    17
    You are right. Its a spread sheet. The different GIFT spread sheets are for two different competitions. I am very much new to access.
    Thank you

  6. #6
    CarlettoFed is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    273
    Unfortunately inside the .doc file none of the images are displayed.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,645
    Images show for me.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    They are there when I open it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    CarlettoFed is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    273
    The images occupy the space but I see nothing.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,645
    Don't know why. I see images just fine.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,280
    Quote Originally Posted by CarlettoFed View Post
    Unfortunately inside the .doc file none of the images are displayed.
    They do take a while to load.?

    Is this any better?
    Attached Files Attached Files
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  12. #12
    Join Date
    Apr 2017
    Posts
    1,776
    Based on all posts here you need tables like:
    tblEmployees: EmployeeID, FirstName, LastName, ...;
    tblCompetitions: CompetitionID, CompetitionName, ...;
    Optionally (in case same gifts can be given in different competitions, or to different employees) tblGifts: GiftID, GiftName, ...;
    And finally, either (in case you have tblGifts, you link to it using GiftID, otherwise you enter GiftName directly into tables below):
    tblCompetitionGifts: CompetitionGiftID, CompetitionID, GiftID/GiftName;
    tblCompetitionEmployeeGifts: CompetitionEmployeeGiftID, CompetitionGiftID, PersonID.
    or:
    tblCompetitionEmployeeGifts: CompetitionEmployeeGiftID, CompetitionID, EmployeeID, GiftID/GiftName, PersonID.

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

Similar Threads

  1. Help with forms - beginner problem
    By MikeEmerald in forum Forms
    Replies: 7
    Last Post: 02-21-2017, 03:01 AM
  2. Inventory Problem Beginner Database
    By joe.ise in forum Database Design
    Replies: 38
    Last Post: 08-27-2013, 12:16 PM
  3. Beginner thread, 1 problem when using forms
    By c.yyang in forum Access
    Replies: 8
    Last Post: 06-22-2013, 11:26 PM
  4. Problem with tables (beginner)
    By alouest in forum Access
    Replies: 5
    Last Post: 04-05-2012, 12:08 PM
  5. Help a DB beginner
    By adquinn in forum Access
    Replies: 0
    Last Post: 02-08-2011, 08:25 PM

Tags for this Thread

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