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

    Records not saving after updating combo box

    Good day,



    I created a lunch menu system that I want to save menu for the days of the week. When the record is updated and click "Add Record" the data overwrites the record that is displayed. I need the form to add record and clear form for selection of new information.
    Not sure what I am doing wrong but any help will be appreciated.

    Please see file attached for any help.

    Nika
    Attached Files Attached Files

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Here you go. Changed the macro for the save button to go to a new record instead of next record.
    Also changed caption of the button from "Save Record" to "New Record". Save is automatic, you don't need a button.
    LunchMenuFinal-v2.zip

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Your add button should go to a new record. It's set to go to the next record.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    nika.duncan is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    36
    When I change the add button to go to new record I am unable to add another record. It generate the error "Cannot add recodr(s), join key of table 'Staff Detail' not in recordset and it is the same error when I used the "New Record" button.

    Any help will be appreciated.
    Nika

  5. #5
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    A bit of table notes: do not carry the staff name in more than one table. Use the Staff_UD as the field to store on any other table requiring the staff name. Branch has also been duplicated, this only needs to be stored once in the database.

    For your form, the record source should be the table you are adding to - Staff_Detail. Not the query. The staff name on the form will be bound to the StaffUD on the detail table and will contain the StaffUD and the Staff Name and the branch, with the UD not being shown.

  6. #6
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Worked on this a bit more, see the results here.
    Made wholesale changes to relationships. Using autonumber primary keys and numeric foreign keys for linkage instead of text field keys.
    Nika-LunchMenuFinal-v4.zip
    Question about branch (which is in 2 tables, a no-no). Can a staff member be in 2 branches? Is a branch related more to where the meal is prepared, or to the staff member?
    Question about weeks: Do you want to assign meals for more than one week at a time? Do you want to delete the meal assignments after a given time?

    Unless all groups are required when building meals, suggest you add a choice to each food group for each day, "Skip", so that something is available to enter.
    Last edited by davegri; 02-15-2018 at 12:31 AM. Reason: expound

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

Similar Threads

  1. Replies: 31
    Last Post: 05-29-2017, 08:21 AM
  2. Replies: 12
    Last Post: 02-15-2016, 11:10 AM
  3. Replies: 6
    Last Post: 02-19-2014, 11:11 AM
  4. Replies: 1
    Last Post: 04-08-2013, 12:04 PM
  5. Combo Box not saving to table
    By dgriffin in forum Forms
    Replies: 11
    Last Post: 06-08-2011, 03:04 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