+ Reply to Thread
Results 1 to 3 of 3

Syntax error (Missing operator) in query expression

  1. #1
    Registered User
    Join Date
    08-14-2013
    Location
    Kentucky, United States
    MS-Off Ver
    03,07,10
    Posts
    61

    Exclamation Syntax error (Missing operator) in query expression

    Hello,

    I am working in a database where I am trying to link two combo boxes to where when a specific selection from one box (dictionary) gives specific choices in the drop down in the other combo box.

    Here is where I obtained my information and what I have so far as well as the error I am reciving:

    Syntax error (Missing operator) in query expression 'Maint DBI.Description'.

    I based my information on example 2 from the site :
    HTML Code: 
    This example uses a single table which provides data for the Row Source of both combo boxes. The table (Maint DBI) contains two fields, one for the Dictionary and the other for the Description to which it belongs...


    I first created a standard list on an excel file and imported it. I named my imported file (Maint DBI).

    Dictionary Description
    Physician Physician
    Physician Ref Physician
    Referral Outside Fac
    Referral Clinical Liaison
    Referral Discharge Planner
    Referral Multi Referrals

    I set The Row Source property of the Dictionary combo box as Physician on the first line and Referral on the second line.

    I then placed the following code on the After Update event of the Dictionary combo box:
    Please Login or Register  to view this content.
    I am new to writing VBA. I am not sure how to set The Row Source property of the Dictionary combo box to take the form of a SQL statement to represent a query of the Maint DBI table returning the unique values found in the Description field, sorted into ascending order:

    Please Login or Register  to view this content.
    Please let me know if I am confusing on any part.

    thanks!!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Syntax error (Missing operator) in query expression

    I set The Row Source property of the Dictionary combo box as Physician on the first line and Referral on the second line.
    I don't understand this statement.
    You should be setting the row source for the combo box as
    Please Login or Register  to view this content.
    You do this by opening the properties for the combo box. For the row source in the data tab, click on the ellipsis (...). This will open a query in design view. Select your table Maint DBI and the field dictionary. Switch the view to SQL. In the upper left corner you will see an Icon that looks like a data sheet, click on the drop down arrow and select SQL. Edit the SQL statement to include the work DISTINCT and then save and close the SQL statement. Your SQL statement should look like your example.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    08-14-2013
    Location
    Kentucky, United States
    MS-Off Ver
    03,07,10
    Posts
    61

    Re: Syntax error (Missing operator) in query expression

    Since my previous post I have set my Row type set as: Table/Query I have My row source set with the SQL statment in "Write SQL query Builder" :

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Syntax Error in Query Expression
    By acmagyar in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2013, 03:11 PM
  2. Syntaxt Error (missing operator) in query expression!
    By jdgwebdev in forum Access Tables & Databases
    Replies: 3
    Last Post: 02-25-2013, 09:32 AM
  3. [SOLVED] Missing Operator in Query Expression
    By dollylectric in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-19-2012, 02:20 PM
  4. Syntax Error (missing Operator) in query expression
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-25-2011, 11:59 AM
  5. [SOLVED] Syntax error (missing operator) in query expression '6 Wescott Rd#
    By shealy in forum Excel General
    Replies: 0
    Last Post: 06-09-2005, 05:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1