Results 1 to 4 of 4
  1. #1
    accesscoder is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2010
    Posts
    19

    Navigation buttons deafult saving


    Hello everybody,

    I have record navigation buttons ( first, next, previous, last ) on the form. When the user clicks on any of these buttons corresponding record is displayed on the form. User may change the data. Whenever user changes the data, it gets updated in the table also. I don't want this default behavior, instead I want user to explicitly press the 'Save' button provided by me to update the changed data into the table.
    Here, navigation buttons are located on the main form, while the data is present on the sub form.

    Please guide me on how can I achieve this?
    I appreciate your help!

    Thank you!

  2. #2
    slave138's Avatar
    slave138 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    WI
    Posts
    233
    I would use the OnDirty event of the subform to disable/enable buttons with something like:

    Me.Parent!ControlName.Enabled = [False for Nav buttons/True for Save button]

    Then use the OnCurrent and AfterUpdate events for the subform to set the button defaults (Save disabled and the Nav buttons enabled)
    Last edited by slave138; 10-16-2010 at 02:00 PM. Reason: Corrected error

  3. #3
    accesscoder is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2010
    Posts
    19
    Thank you for the reply!

    From what I understood from your reply is not going to solve the problem.
    I want to override the default save functionality associated with the navigation buttons. When user presses the navigation button and updates the data, I don't want the data to be updated in the table.

    From your suggestion, I can disable the buttons in the dirty event and then enable them again in current/after_update event, still when in the navigation mode form data is updated, it will be saved automatically i.e without pressing the 'Save' button explicitly.

    Please let me know if I am not clear with your idea or if you need more explanation about the problem.

    Thanks!

  4. #4
    slave138's Avatar
    slave138 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    WI
    Posts
    233
    I think you are mistaken with how Access functions. Navigating alone does not update the records. Unless they are changed in some fashion (onDirty) nothing happens when moving to a new record. If they are changed and you go to a new record, it updates the DB.

    So, to prevent it from updating due to navigation, you disable navigation if the record is changed until it is saved in the manner you intended.

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

Similar Threads

  1. Help with navigation
    By phelpsville in forum Access
    Replies: 0
    Last Post: 04-16-2010, 07:33 PM
  2. Replies: 0
    Last Post: 12-12-2009, 04:45 PM
  3. Navigation Buttons not working please help
    By dinarocks74 in forum Access
    Replies: 3
    Last Post: 06-26-2009, 10:15 AM
  4. Control Navigation Bar
    By Patrick.Grant01 in forum Access
    Replies: 0
    Last Post: 05-17-2009, 06:16 AM
  5. Navigation Code
    By henryclay in forum Forms
    Replies: 2
    Last Post: 11-15-2006, 09:48 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