Results 1 to 2 of 2
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    turn "about to delete record" warning back on

    on a single record form, I have a command button that simply deletes the current record (see code below)

    problem is that somewhere in the project, the warning that you are about to delete a record is occassionally (but not always) turned off, and I haven't yet been able to locate the lines that are doing it ...

    as a work around, I thought adding the line "DoCmd.SetWarnings True" would restore the warning; this is obviously not correct..

    any thougths and suggestions will be greatly apreciated in advance,
    Mark


    Private Sub cmdDeleteType_Click()
    On Error GoTo Err_cmdDeleteType_Click
    < ... >
    'delete the current record and move to the previous one
    DoCmd.SetWarnings True
    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70


    If Me.NewRecord Then
    DoCmd.GoToRecord , , acPrevious
    End If
    < ... >

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    That should work, it does for me.

    If search of VBA code does not find the SetWarnings, is there a macro that might have one?

    Instead of DoMenuItem (what is the action you want to run), consider RunCommand

    DoCmd.RunCommand acCmd...
    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: 17
    Last Post: 06-04-2012, 05:11 PM
  2. Write "Edit List Items.." data back to original form.
    By ngahm in forum Database Design
    Replies: 33
    Last Post: 02-27-2012, 06:54 PM
  3. Disable security warning to "enable content"?
    By Heatshiver in forum Security
    Replies: 2
    Last Post: 02-03-2012, 02:26 PM
  4. Replies: 3
    Last Post: 12-06-2010, 04:06 PM
  5. Replies: 4
    Last Post: 06-14-2010, 02:31 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