Results 1 to 4 of 4
  1. #1
    Nelda is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2011
    Posts
    2

    Syntax error (missing operator) in query expression '[emri_universitet]=ABC Universi

    PLZ help me. I am new in Access. I am creating a contact database. I need to create cascading list for forms. I have 4 cascading list:
    cboTipiOrganizata that define the type of organization, depended of the chose it select one of 4 tables of the types of organization, the after update event procedure is:

    Private Sub cboTipiOrganizata_AfterUpdate()
    On Error Resume Next
    Select Case cbotipiorganizata.Value
    Case "Institute Kerkimore"
    cboOrganizataEmri.RowSource = "tlbInstituteKerkimore"
    Case "Institute Publike"
    cboOrganizataEmri.RowSource = "tlbInstitutePublike"
    Case "NGO"
    cboOrganizataEmri.RowSource = "tlbNGO"


    Case "SME"
    cboOrganizataEmri.RowSource = "tlbSME"
    Case "Universitet"
    cboOrganizataEmri.RowSource = "tlbUniversitet"
    End Select
    End Sub


    The result is showed at cboEmriOrganizata, where we chose the name of the organizatin

    If the chose in tlbUniversiteti (tblUniversity), i have one more cascading list to define the faculty named cboFakultetiEmri

    In the after update event procedure of cboEmriOrganizata i have put this code:

    Private Sub cboOrganizataEmri_AfterUpdate()
    Dim sFakulteti As String
    sFakulteti = "SELECT [tlbFakultet].[emri_fakultet]," & _
    "[tlbFakultet].[id_fakultet]," & _
    "[tlbFakultet].[emri_universitet]" & _
    " FROM tlbFakultet " & _
    " WHERE [emri_universitet] = " & Me.cboOrganizataEmri.Value & ";"
    Me.cboFakultetiEmri.RowSource = sFakulteti
    Me.cboFakultetiEmri.Requery
    End Sub


    When i chose the University name (at cboUniversitetiEmri combo) and then go to chose the Faculty name (at cboFakultetiName) i give the follow error:

    Syntax error (missing operator) in query expression '[emri_universitet]=ABC University'.

    Where ABC University is one of the name of the university recordet in table


    Thanks in advance!

  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,521
    A text value has to be surrounded by quotes. Try

    " WHERE [emri_universitet] = '" & Me.cboOrganizataEmri.Value & "';"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Nelda is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2011
    Posts
    2
    Thank you!

  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,521
    Happy to help, and welcome to the site by the way!
    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. Unable to fix a missing operator error
    By dhaneshjs in forum Access
    Replies: 6
    Last Post: 05-25-2011, 10:14 AM
  2. Syntax error missing operator(3075)
    By parisienne in forum Programming
    Replies: 1
    Last Post: 04-07-2011, 02:29 PM
  3. Syntax Error...missing operator
    By jgelpi16 in forum Programming
    Replies: 14
    Last Post: 09-09-2010, 11:35 AM
  4. Replies: 1
    Last Post: 10-07-2009, 07:36 AM
  5. Missing Operator error
    By data123 in forum Forms
    Replies: 1
    Last Post: 03-15-2009, 04:34 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