Results 1 to 9 of 9
  1. #1
    samot79 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2017
    Posts
    21

    Mapping recipe to customers

    Hi,

    Hopefully an easy questions.

    RecipeTable


    ID Name
    1 A
    2 B

    PatientTable
    ID Name
    1 John
    2 Jane

    PatientRecipeTable
    PatientID RecipeID
    1 1
    1 2


    Now I want to make sure that all Patients are mapped to a recipe.

    Code:
    SELECT ID, NameFROM PatientTable
    WHERE NOT EXISTS (SELECT PatientRecipeTable.PatientID
                     FROM PatientRecipeTable
                     WHERE PatientTable.ID =PatientRecipeTable.PatientID)
    Gives me the data I want from my PatientTable. How can I update my query so I get a third field, a combobox/dropdown with all available recipe from my recipe table?

    I also want that value entered in this combobox/dropdown also updates my PatientRecipeTable?

    Really appreciate some help on this.

  2. #2
    Demerit's Avatar
    Demerit is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    125
    check out the attachment if that solves your problem.


    Database2.zip

  3. #3
    samot79 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2017
    Posts
    21
    Hi,

    Thanks for your reply but it feels a bit awkward to open an zip file.

    I thought it was an easy task to add a new field from another table to update records

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    What is awkward about it? I opened the zip file just fine.

    The database demonstrates what you are asking for and should work just fine. However, I don't ever build lookups in tables. I build comboboxes on form.
    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.

  5. #5
    Demerit's Avatar
    Demerit is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    125
    here is the unzipped file

    Database2.accdb

  6. #6
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    use query design, bring in the 3 tables,
    join them all on their IDs.
    bring down all fields you want.
    save, run the query.

  7. #7
    samot79 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2017
    Posts
    21
    I was afraid of virus..

    This is very useful for me, thanks!

    Why is it better to do this on a userform?

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    If you are the only user, do whatever you want. If this is intended for other end users, those users should not work directly with tables and queries. Build forms and reports to manage interaction with data.

    I've never had a bad experience with any files downloaded from any user forum site or from fileshare sites used to make larger files available.
    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.

  9. #9
    samot79 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2017
    Posts
    21
    Ok, thanks again.

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

Similar Threads

  1. Suitable way to search different recipe
    By chezster1234 in forum Access
    Replies: 2
    Last Post: 03-16-2017, 08:40 AM
  2. recipe file database help to start
    By JohnnyS in forum Access
    Replies: 6
    Last Post: 01-09-2017, 04:27 PM
  3. Replies: 1
    Last Post: 09-09-2014, 11:29 PM
  4. Database: From recipe to shopping list
    By schwabe in forum Database Design
    Replies: 3
    Last Post: 05-17-2014, 07:48 PM
  5. Recipe book issues
    By gumberculies in forum Access
    Replies: 2
    Last Post: 10-07-2011, 10:58 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