acCmdDeleteRecord does nothing?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Knut Ole
    New Member
    • Mar 2011
    • 70

    acCmdDeleteRecord does nothing?

    hi,

    the acCmdDeleteReco rd seems to be working, but in fact does nothing in the following code. (line 10.)
    Code:
    If virginr = True Then
                strMsg = "Do you really want to CANCEL the new reservation?"
                If vbYes = MsgBox(strMsg, vbYesNo + vbQuestion + vbApplicationModal, "Cancel Reservation") Then
                    DoCmd.RunCommand acCmdUndo
                    MsgBox "undo. close form."
                    DoCmd.Close
                End If
            Else
                DoCmd.RunCommand acCmdSelectRecord
                DoCmd.RunCommand acCmdDeleteRecord
                mnam = Me.Name
                MsgBox "acCmdDel done " & mnam
                DoCmd.Close acForm, "frmNewReservation", acSaveYes
                
            End If
    That is, I get no error message, the form seemingly resets itself (the ID turns into "(New)"). However, the actual record is still there!

    Any suggestions? I've found some hints towards it being a bug - in that case, any alternate solution tips?

    thanks a lot!
  • Knut Ole
    New Member
    • Mar 2011
    • 70

    #2
    for future reference:

    acDmdDeleteReco rd is apparently not always trusty, so this took care of it instead.
    Code:
                strSQL = "DELETE * FROM Bookings WHERE ID=" & intID
                DoCmd.RunSQL strSQL

    Comment

    Working...