Results 1 to 2 of 2
  1. #1
    tariq1 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    16

    On delete

    Hi,

    Thank you in advance for your assistance
    I am trying to run the code below when the user attempts to delete a record,
    however I receive
    'Compile Error: Expected sub,function or property'


    Code:
    Private Sub Form_Delete(Cancel As Integer)
    Dim intanswer As Integer
    Dim stranswer As String
    stranswer "Are you sure you want to delete this product?"
    intanswer = MsgBox(Str, vbQuestion + vbYesNo, "Delete Product")
    If intanswer = vbYes Then
    RunCommand acCmdSelectReport
    DoCmd.RunCommand acCmdDeleteRecord
    End If
    
    HandleError:
    MsgBox "Error is " & Err.Description
    Resume exithere
    End Sub

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You don't have an = setting the first variable.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 01-24-2012, 02:16 PM
  2. Delete DB Value from Listbox
    By Fatti in forum Forms
    Replies: 2
    Last Post: 01-14-2012, 06:20 PM
  3. Trying to Delete record using delete query
    By MooseOTL in forum Access
    Replies: 13
    Last Post: 10-04-2011, 02:30 AM
  4. Replies: 11
    Last Post: 03-30-2011, 01:08 PM
  5. Replies: 1
    Last Post: 07-22-2010, 05:52 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