Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syntax error (Access 2000)

    I receive the message syntax error, missing operatior when i try to find the the record in the field code in my form:

    Dim strCode As String
    Dim strBookmark As String
    strCode = InputBox("Please enter Code number ")
    If strCode = "" Then
    Exit Sub
    End If
    Me.RecordsetClone.FindFirst "Me!Code = " & strCodeID
    If Me.RecordsetClone.NoMatch Then
    MsgBox "Code " & strCode & " Not Found!!"
    Me.Bookmark = strBookmark
    Else
    Me.Bookmark = Me.RecordsetClone.Bookmark
    End If


    What have i done wrong?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Syntax error (Access 2000)

    Look carefully at the names of the variables you use in the code. There is one inconsistency that sticks out.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Syntax error (Access 2000)

    Many thank,i overlooked this glaring ovresight.I can now find the code, but at the end the windows appears asking me again to enter
    code number,and i have to cancel it.Can i avoid this window appearance?


    Dim strCode As String
    Dim strBookmark As String
    strCode = InputBox("Please enter Code number ")
    If strCode = "" Then
    Exit Sub
    End If
    Me.RecordsetClone.FindFirst "Code = " & strCode
    If Me.RecordsetClone.NoMatch Then
    MsgBox "Code " & strCode & " Not Found!!"
    Me.Bookmark = strBookmark
    Else
    Me.Bookmark = Me.RecordsetClone.Bookmark
    End If

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Syntax error (Access 2000)

    I don't know why that would happen. I would remove the line

    Me.Bookmark = strBookmark

    The variable strBookmark is never assigned a value, so you might as well remove the declaration

    Dim strBookmark As String

Posting Permissions

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