Results 1 to 5 of 5
  1. #1
    ramindya is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    20

    Save the updated data

    Hello:



    Attached is the application that I am working on.

    The application has two list boxes and I am able to move the data from one list box to another list box which updates the data in the table (tblnames)
    but it does not save the data permanently whenever I open the application it default sets the values to Yes to all the people in the ShowYesNoFilter field.

    The add and remove operations are done through behind the form(please look at the viewcode).

    Question/Issue: Whenever I reopen the application the changes that I made earlier -(the names that were moved to ListNoItems which also updated
    the tblnames tables ) all got reset to Yes.Can you please let me know how to save the changes permanently?

    Thanks,
    Ram
    Attached Files Attached Files

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Can you attach your file in mdb format? Some of us are unable to use accdb format.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    This line in the form's Open event runs a procedure that resets all the records to Yes.

    ExecuteCommand mstr_SQLInstruction, mstr_Yes

    Set a breakpoint on that line, use step debugging technique, follow the code as it executes.
    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
    ramindya is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    20

    Solution

    I changed the mstr_Yes in the Form_Open event to mstr_No and now it does not reset all the values to Yes and it works as I expected that is
    changes that I made are saved permanently even after I re open the MS ACCESS database.

    ExecuteCommand mstr_SQLInstruction, mstr_No

    Can somebody good in VBA or programming can confirm me that my solution is correct ?

    Thanks,
    Ram

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    If it does what you want then it must be correct. My question is why do you even need to call this function in the Open event? This function is called 8 times in different events. Does it work properly for all?
    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.

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

Similar Threads

  1. Replies: 8
    Last Post: 01-20-2012, 05:07 PM
  2. Replies: 4
    Last Post: 12-22-2011, 03:04 AM
  3. Replies: 4
    Last Post: 01-05-2011, 07:56 AM
  4. Force form not to save updated fields
    By Evgeny in forum Programming
    Replies: 2
    Last Post: 04-30-2010, 10:44 PM
  5. Find data, load data, and save as a new record
    By hawzmolly in forum Access
    Replies: 0
    Last Post: 10-05-2008, 03:18 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