Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2010
    Posts
    4

    Problem creating Multi level list boxes - pleas help!

    Hi, I have created a form that has 3 list boxes.

    The first list box contains the project name. Based on whatever is selected in the Projects list box, the 2nd list box is generated with Custodian names associated with that project. I am having problems generating the 3rd list box. This holds the data sources associated with whatever is selected in the 2nd list box (Custodians).

    List13 = Project listbox
    Custodian = Custodian listbox
    List15 = Data source listbox


    The first 2 are working but I am not able to generate anything for the 3rd list box.


    In my VB Code, I have:

    Private Sub List13_AfterUpdate()
    Custodian.Requery
    End Sub

    Private Sub Custodian_AfterUpdate()
    List15.Requery
    End Sub

    When I switch to form view, I get the following error:

    "This expression has been typed incorrectly, or is too complex to evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables."



    My SQL query for the second listbox (Custodians) :

    SELECT DISTINCT Custodian_T.Name_First_NV, Custodian_T.Name_Last_NV, Project_T.Custodian, [Project Names].[Project Type ID]
    FROM Custodian_T INNER JOIN ([Project Names] INNER JOIN Project_T ON [Project Names].[Project Type ID] = Project_T.Project_Type) ON Custodian_T.Custodian_ID = Project_T.Custodian
    WHERE ((([Project Names].[Project Type ID])=[list13].[value]));


    My SQL query for the third listbox (Data Source):

    SELECT Data_Source_T.Name_NV, Project_T.Data_Source, Project_T.Custodian, Custodian_T.Custodian_ID
    FROM Data_Source_T INNER JOIN (Custodian_T INNER JOIN Project_T ON Custodian_T.Custodian_ID = Project_T.Custodian) ON Data_Source_T.Name_NV = Project_T.Data_Source
    WHERE (((Custodian_T.Custodian_ID)=[Custodian].[value]));


    What am I doing wrong here? How can I get my third list box to generate anything?

  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
    In a query you need the full form reference:

    WHERE ((([Project Names].[Project Type ID])=Forms!FormName.
    [list13]));
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Join Date
    Oct 2010
    Posts
    4
    I tried that, it doesn't work either. My first 2 list boxes are working properly, there is something that I am doing incorrectly for the 3rd list box.

  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
    If you paste the SQL into a query does it run?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Join Date
    Oct 2010
    Posts
    4
    Yup when I paste it into a separate query (minus the WHERE clause) it runs.

    The "WHERE" is the part that generates something based on the previous lists selection.

    So why isn't this working? This error message keeps popping up:

    "This expression has been typed incorrectly, or is too complex to evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables."

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    So it doesn't run if you paste the whole thing into a query and run it? What is the actual SQL now?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Join Date
    Oct 2010
    Posts
    4
    Yes I meant it works when I copy and paste that into a separate query. This is not letting me link link tables..

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

Similar Threads

  1. 2 multi select list boxes on one search form
    By woodey2002 in forum Forms
    Replies: 2
    Last Post: 11-05-2010, 12:44 PM
  2. Multi-select List Boxes
    By Rawb in forum Programming
    Replies: 6
    Last Post: 09-21-2010, 09:02 AM
  3. generate multi-level csv
    By shank in forum Queries
    Replies: 5
    Last Post: 09-16-2010, 04:25 AM
  4. Multi Level Form
    By bkelly in forum Access
    Replies: 2
    Last Post: 08-28-2009, 11:15 AM
  5. Replies: 1
    Last Post: 03-01-2009, 09:53 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