Results 1 to 3 of 3
  1. #1
    melb is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2015
    Posts
    12

    Error with Syntax in Form

    I have a form, it keeps giving me runtime error 3075



    Syntax error missing operator in query express 'adressid='

    Set rs = CurrentDb.OpenRecordset("SELECT count(*) FROM correspondence where addressid=" & Me.AddressID)

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    You didn't ....hmmm,it looks right UNLESS addressId is null. Then it fails.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Is addressID defined as a Number or as Text? Your syntax is only correct if it is defined as a Number...and all 'digit only' fields are not defined as Numbers, especially ID numbers, SSNs, Area Codes, Zip Codes, etc. Most developers only use Number Datatypes if the Field can or will be used for math.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 3
    Last Post: 02-13-2015, 10:18 AM
  2. Replies: 1
    Last Post: 02-21-2013, 12:27 PM
  3. Append Query From Form Syntax Error
    By burrina in forum Forms
    Replies: 8
    Last Post: 01-02-2013, 10:37 AM
  4. Syntax Error For Main Form Subform Report
    By burrina in forum Reports
    Replies: 1
    Last Post: 12-27-2012, 03:03 AM
  5. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 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