Results 1 to 4 of 4
  1. #1
    timesscript is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    34

    Syntax Error in FindFirst 1/2 of the time

    I use the following code in an afterupdate to set the record to one chosen in Listbox


    [List6]. If the user chooses a valid record in the listbox, it works fine- no errors. However, sometimes the listbox is blank and the user will select the listbox when it's blank. Then I get this error: Run time error 3077: Syntax error (missing operator) in expression.
    Any thoughts?

    Code:
     Set rs = Me.Recordset.Clone
     rs.FindFirst "[SuspensionID] = " & Me!
    [List6]
     If Not rs.EOF Then Me.Bookmark = rs.Bookmark

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,524
    You can test first:

    If Len(Me.List6 & vbNullString) > 0 Then
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    timesscript is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    34
    Exactly what I needed Paul, thanks a bunch!

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,524
    Happy to help!
    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. .findFirst 3077 syntax error
    By RonL in forum Programming
    Replies: 3
    Last Post: 04-05-2015, 04:22 PM
  2. Replies: 11
    Last Post: 05-01-2014, 11:56 AM
  3. Replies: 3
    Last Post: 03-05-2013, 11:17 AM
  4. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  5. using FindFirst with a Date Criteria (syntax error)
    By ajetrumpet in forum Programming
    Replies: 2
    Last Post: 09-10-2010, 11:01 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