Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Thanked 0 Times in 0 Posts

    How to avoid the error message (Access 2000)

    How to avoid the error message

    I have a function called CancelOrderOnExit which serves to return the goods and delete the order
    in case the user suddenly decides to leave the process of issuing a document. The function actually works,
    and performs the tasks or updating and deleting,but on the click event the following message appears:
    Syntax error (missing operator) in query expression
    But if i press ok, then the functions works and gives the right results.
    Is there any way to avoid the appearance of this error message?

    The function looks like this:

    Public Function CancelOrderOnExit()
    Dim frm As Form
    Set frm = Forms![FOrderInformation]
    Dim StrSQL1 As String
    Dim strSQL2 As String
    Dim strSQL As String
    ' 1 update the order before deleting it
    ......... coding

    DoCmd.RunSQL StrSQL1
    DoCmd.RunSQL strSQL2
    End Function

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: How to avoid the error message (Access 2000)

    From the error message, I would guess that the error occurs in one of the DoCmd.RunSQL instructions. Which one is it? You will need to post the offending SQL string, and the code that assembles the SQL string that causes the error. You omitted that part from your post...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts