Results 1 to 10 of 10
  1. #1
    moises is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    15

    record in form & table not updating when saved

    Hi guys,

    When i save the new record that inserted is not updating in the table & form and also when click the cmdPreviousRec its escaping the inserted record.

    Please can anyone help me.

    Attaached file is the one i'm working:
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The save button appears to be disabled. What is the result of the Debug.Print?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    moises is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    15
    Hi paul,

    Actually there's no error when i save the new record, but it's not updating directly in the table & form. When i navigate thru my custom navigation button it is escaping the new record, i can see only the last previous record not the new inserted record in the table.

  4. #4
    moises is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    15
    I can see only the new inserted data when i cloase and reopen the form

  5. #5
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You are saving the new record to the table using code; in order to see the new record on the form, you need to requery the form's recordsource (Me.requery), but note that when you do that, the form will reset to the "first" record - it won't automatically go to the last record you were on. You will need a bit of VBA to keep track of where you are.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What I meant was to use this technique:

    BaldyWeb-Immediate window

    I can't see how the data could be there after closing the form, since the textboxes are unbound. I closed it and there was no data in the table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    moises is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    15
    Hi john,

    You're right john the me.requery is not updating automatically. I need to close and re-open the form to see the new inserted data.

    How could i fix this issue?

  8. #8
    moises is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    15
    Hi paul,

    The debug.print shows the data is inserted into table.
    Attached Thumbnails Attached Thumbnails IMG_20141225_074225.jpg  

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by moises View Post
    The debug.print shows the data is inserted into table.
    No, it shows SQL that may or may not be valid. Can't tell from a picture, and in my test it was bad.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    moises is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    15
    Hi guys,

    I have solved my problem...

    I forgot to add the code rs.addnew

    Thanks a lot...

    Merry Christmas

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

Similar Threads

  1. Replies: 5
    Last Post: 12-03-2013, 02:06 PM
  2. Replies: 1
    Last Post: 11-28-2012, 01:01 PM
  3. Replies: 1
    Last Post: 04-19-2011, 04:46 PM
  4. Updating another record table with command button
    By erlan501 in forum Programming
    Replies: 5
    Last Post: 04-26-2010, 09:03 AM
  5. Replies: 9
    Last Post: 02-19-2010, 12:07 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