Results 1 to 4 of 4
  1. #1
    lzook88 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    75

    Extra ')' in query Expression

    I am getting an error when I change a combo-box.



    The coding is set up to find all certifications that pertain to that userid

    when i change the user id and click on the drop down for the certifications it gives me and error

    Code:
    Extra ) in query expression '(((qryCerts.HashID)=))'.
    and the code it is looking at is:

    Code:
    Me.Certification.RowSource = "SELECT DISTINCTROW qryCerts.ID, tblCertificationTypes.CertType, qryCerts.CertNum, qryCerts.Issued, qryCerts.Expiration, qryCerts.HashID, tblCertificationTypes.CertType_ID " & _
    "FROM tblCertificationTypes INNER JOIN qryCerts ON tblCertificationTypes.CertType_ID = qryCerts.Certification " & _
    "WHERE (((qryCerts.HashID)=" & Me.Combo31 & ")) " & _
    "ORDER BY tblCertificationTypes.CertType;"
    If I type in the username to get it to populate it gives me the error and then if i hit okay on the error message and select a user name, it begans working with out issue.

    but if i select it from the list, i dont get an error.


    thanks for the help

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,972
    None of the parens are necessary but should not cause error. I think you would still get error message if the parens are removed. Something else is true issue. The error message doesn't show any value from the combobox.

    Would need to examine combobox properties and code to determine exactly what.

    Why are you changing the combobox RowSource? Could just set the RowSource property to the SQL statement and then code just has to requery the combobox - only don't use the Me reference.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    lzook88 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    75
    It is because I have the code in CHANGE not in LOST_FOCUS .. so each letter i type, it looks for it one letter at a time! with lost focus. it waits until i tab off or click out side the combo box to update the next combobox

  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,530
    I would use the after update event rather than lost focus; you really only care if the user changed something, not if they just tab through. Also, as you note the change event fires with every keystroke, so it is rarely needed. When it is, you need to use the .Text property of the control to get the value being typed in. That's likely why there's no value in your error message.
    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. Replies: 2
    Last Post: 04-11-2013, 06:36 PM
  2. update query that removes extra letters
    By alinapotter in forum Queries
    Replies: 4
    Last Post: 04-06-2013, 01:15 PM
  3. Replies: 1
    Last Post: 09-21-2012, 12:02 PM
  4. query returning extra items
    By cbrsix in forum Queries
    Replies: 6
    Last Post: 07-05-2011, 02:22 PM
  5. Query. Extra column.
    By seweryng in forum Queries
    Replies: 1
    Last Post: 01-14-2011, 08:59 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