Results 1 to 4 of 4
  1. #1
    desk4tbc is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    29

    Syntax Error


    Hi, I don't know why its giving me a 3075 runtime error.
    "Syntax error(missing operator) in query expression 'Patient_ID='."

    Code:
    Private Sub Form_Current()
    If IsNull(DMax("Group", "PetList", "Patient_ID=" & Me.Patient_ID)) And Not IsNull([Patient ID]) Then
        Me.Parent!imgExc.Visible = True
        Me.Parent!labExc.Visible = True
    Else
        Me.Parent!imgExc.Visible = False
        Me.Parent!labExc.Visible = False
    End If
    End Sub
    Its saying I'm missing an operator but isn't the "=" the operator in this case? Patient_ID is an integer, could that be the reason?

  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,640
    The lack of a value after the = in the error implies that it isn't finding a value in Me.Patient_ID. I'd double check that's the right control.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    desk4tbc is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    29
    Ah Thanks. The problem was aggravated by the fact that the first line was Null in Patient_ID, so I received the prompt at load. Now I know what to look for if that happens again.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    No problemo.
    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. SQL Syntax Error
    By NoiCe in forum Queries
    Replies: 5
    Last Post: 04-01-2011, 11:43 AM
  2. Need help with Syntax Error
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 02-04-2011, 08:34 AM
  3. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM
  4. Syntax error
    By smikkelsen in forum Access
    Replies: 6
    Last Post: 04-28-2010, 09:38 AM
  5. Syntax Error
    By KLynch0803 in forum Programming
    Replies: 11
    Last Post: 02-04-2010, 01:45 AM

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