Results 1 to 4 of 4
  1. #1
    Bradex is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    101

    No save prompt after Yes/No (check box)


    I was surprised to find that access auto-saves changes to the Yes/No (checkbox) control without prompting me to save the changes.

    I find it highly inappropriate as a random left-click on the form by mistake can easily change the checkbox data and it also get saved!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    The checkbox is just another data entry control. No data entry control has any built-in prompting to challenge the user if they really want to make this change. You can program this behavior in the control's BeforeUpdate event. Or use a combobox for the yes/no field input. I've used a combobox.
    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.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    You could put some code in the Before Update event of the checkbox control. Something like:
    Code:
        If MsgBox("Update Record?", vbYesNo, "Confirmation Required") = vbNo Then        Cancel = True
        End If
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    Bradex is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    101
    I am an amateur user, and just learnt that Access autosaves all entries/edits in the form.

    Since I wanted it to prompt me for saving before closing or moving on to a new record, I used the following code (learnt from elsewhere, full credits to the original code author):

    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
    If Not (Me.NewRecord) Then
     If MsgBox("Would You Like To Save The Changes To This Record?", vbQuestion + vbYesNo + vbDefaultButton1, "Save Changes to Record ???") = vbNo Then
      Me.Undo
     End If
    Else
     If MsgBox("Would You Like To Save This New Record?", vbQuestion + vbYesNo + vbDefaultButton1, "Save This Record ???") = vbNo Then
      Me.Undo
     End If
    End If
    End Sub

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

Similar Threads

  1. Replies: 2
    Last Post: 05-24-2017, 08:34 PM
  2. save as prompt with hard code path
    By xopherira in forum Programming
    Replies: 8
    Last Post: 09-09-2015, 12:57 PM
  3. Replies: 5
    Last Post: 08-03-2012, 08:15 AM
  4. Save changes to layout prompt
    By HunterEngineeringCoop in forum Access
    Replies: 2
    Last Post: 07-07-2011, 08:35 AM
  5. Prompt on close and don't save the null record
    By hasanrazaj1 in forum Forms
    Replies: 2
    Last Post: 10-24-2010, 09:24 AM

Tags for this Thread

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