Results 1 to 3 of 3
  1. #1
    nika.duncan is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    36

    Unable to save records when using Combo Box

    Hey


    I have a database to select lunch for the week where I have created tables to store the choices; appetizer, protein, carbohydrates, side order and vegetables which would be selected by users which should be given to the chef the beginning of each morning. After selection I want the detail to be saved "Staff_Details" table. The combo box works after the first record is selected. When I select the day of the week "Monday" and the appetizer, carb_choice, protein, side orders and vegetables for Monday appears in the drop down combo boxes for selection but to add another record I receive the error message "cannot add record(s); join key of the table "Staff_Detail" not in recordset.

    See file attached for a better understanding of what I am trying to do.

    Any assistance will be greatly appreciated.
    Attached Files Attached Files

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The record source for the form needs to be the name of the table only - Staff_Details.

    Also, one of the rule of database normalization is that data is never to be repeated - the staff name needs to be kept in one table only and the ID key carried to other places as needed.

  3. #3
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,706
    Nika-LunchMenuFinal-v1.zip

    See if this helps.
    Made too many changes to list them all. Renamed table keys with _PK and _FK suffixes. Added search combobox to frmMainMenu.
    Redid the relationship diagram to use the keys instead of the text items.

    Since a staff member could have more than one detail record, I made a "Main Form"/"Subform" setup with Staff_Listing and Staff_Detail

    Note that it's a bad idea to have a field in a table with the same name as the table, like Side_Choice (I changed the field to Side_Dish and Vegie_Choice to Vegie_Dish).
    Another way to avoid this situation is to use a 'tbl' prefix for all table names, like tblVegie_Choice and tblSide_Choice.

    None of the existing queries will run now, but I think they are all unnecessary anyhow.
    Last edited by davegri; 01-30-2018 at 05:33 PM. Reason: suggestion

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

Similar Threads

  1. Unable to save changes to forms, reports.
    By mdnikki in forum Access
    Replies: 3
    Last Post: 12-07-2016, 12:41 PM
  2. Unable to delete records in form
    By George in forum Forms
    Replies: 3
    Last Post: 10-18-2016, 08:35 PM
  3. Unable to Save Changes and Other Problems
    By rjgriffin46 in forum Access
    Replies: 7
    Last Post: 01-10-2015, 04:35 PM
  4. Unable to add additional records
    By MushingJeep in forum Programming
    Replies: 1
    Last Post: 01-15-2014, 10:46 AM
  5. Unable to sort records in database
    By SiyarK in forum Access
    Replies: 6
    Last Post: 02-07-2013, 02:22 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