Results 1 to 10 of 10
  1. #1
    antimoneylaundering is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Posts
    10

    Cascade boxes not working

    I'm an Access newbie (first time user) and am struggling with cascade boxes. I haven't been able to find anything that has helped me.

    I am trying to create boxes with dependencies.
    I have Stage.
    Then Step which is dependent on stage.
    Then Task which is dependent on stage.
    The primary key for each is ID.



    I have a table for Stage, Step, Task, and a full table (which is currently labeled Table 2) which contains information for everything.

    When I go to look at it all of the options are available. For instance, if I select stage all steps are available rather than the ones that are only applicable to that stage.

    Joins
    Full Table to Task (Inner Join)
    Full Table to Stage (Inner Join)
    Full Table to Step (Inner Join)
    Stage to Step (Inner Join)

    I have the following query:
    SELECT Table2.Stage_ID, Table2.Step_ID, Table2.Task_ID
    FROM ((Table2 LEFT JOIN Task ON Table2.[Task_ID] = Task.[ID]) LEFT JOIN Stage ON Table2.[Stage_ID] = Stage.[ID]) LEFT JOIN Step ON Table2.[Step_ID] = Step.[ID]
    WHERE (((Table2.Step_ID)=[Forms]![QA Form_Use_Old]![cboStep]));

    Where am I going wrong?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Why would you create a join on a RowSource for a combo? Granted, there are times where you would want to create a JOIN. However, you are creating Cascading Dependent Combo Boxes.

    So, give each combo a Rowsource for its respective table. Use the Query Builder by clicking the ellipses(...) next to the RowSource Property. Once you have added the appropriate table, add the name of the form and the name of the control to the criteria of the appropriate field (the Foreign Key Field).
    Forms!NameOfForm!NameOfComboIDependOn

  3. #3
    antimoneylaundering is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Posts
    10
    I am working off of a previously created database so that's what it was set up as and I didn't know that you didn't have to have joins. I should have probably specified this initially. I have created row sources. On table 2 I have the following row sources:

    Lookup to stage: SELECT [ID] AS xyz_ID_xyz, [Stage] AS xyz_ID_xyz, [Stage] FROM Stage ORDER BY [Stage];
    Look up to step: SELECT [ID] AS xyz_ID_xyz, [Step] AS xyz_ID_xyz, [Step] FROM Step ORDER BY [Step];
    Lookup to task: SELECT Task.[ID] AS xyz_ID_xyz, Task.[Task] AS xyz_ID_xyz, Task.[Task] FROM Task ORDER BY Task.[Task];

    Will these particular row sources not work? Should I get rid of the query?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    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.

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by antimoneylaundering View Post
    ...Will these particular row sources not work? Should I get rid of the query?
    Those don't look bad. In the form, while in design view, you can view a combo's properties. You can place the name of a Query Object in the Rowsource property or you can place an SQL statement. It is up to you. If you click the elipses(...) the Query Builder will launch and the result will be an SQL statement in the RowSource.

    You can review the video June linked to. It looks like what you have left is to add the WHERE criteria. You can do this by typing something like the following in the criteria field (within the Design Grid at the bottom of the Query Builder window). Understand that the video tutorial that is linked to is of an older version of Access and newer versions do not require you to type "Where". Instead, type ... Forms! [Enter Key] NameOfForm! [Enter Key] NameOfComboIDependOn [Enter Key]

    You can do this from the Query Object or the Form.

    Forms!NameOfForm!NameOfComboIDependOn

  6. #6
    antimoneylaundering is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Posts
    10
    Thank you all for your responses. I have tried adding Forms!NameOfForm!NameOfComboIDependOn to the criteria and it's still not working.
    I have tried to set an Afterupdate event and that is not fixing the problem either.

    I have been looking more closely at the tables and the row sources previously mentioned are the row sources on the form and are not what is on the table. When I looked more closely at "Master Table" I realized that these were lookups. Stage, Step, and Task have separate tables and they are all combined in "Master Table"


    The lookup for stage is:
    SELECT [ID] AS xyz_ID_xyz, [Stage] AS xyz_DispExpr_xyz, [Stage] FROM Stage ORDER BY [Stage];

    The lookup for step is:
    SELECT [ID] AS xyz_ID_xyz, [Step] AS xyz_DispExpr_xyz, [Step] FROM Step ORDER BY [Step];

    The lookup for task is:
    SELECT [ID] AS xyz_ID_xyz, [Task] AS xyz_DispExpr_xyz, [Task] FROM Task ORDER BY [Task];

    Could these lookup fields be my problem?


    *Previously called Table2, but updated to make less confusing.

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I am having a hard time following what you have tried and understanding what your DB looks like. Why don't you create a new Access file and import the relevant forms and tables into the new file. Remove any sensitive/private data, compact and repair, zip it down, and upload here so we can review it.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You reviewed the DataPig tutorial referenced in post 4?

    I am also confused by your descriptions. As ItsMe suggests, provide db for analysis.
    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.

  9. #9
    antimoneylaundering is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Posts
    10
    Unfortunately I cannot upload the database as is. There is no way for me to remove enough information to upload it directly. I will create a replica and provide it.

  10. #10
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    You should also look at this tutorial

    http://www.fontstuff.com/access/acctut10.htm

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

Similar Threads

  1. Replies: 11
    Last Post: 08-06-2014, 09:47 AM
  2. Why aren't my Combo Boxes working?
    By djclntn in forum Forms
    Replies: 2
    Last Post: 02-15-2013, 04:50 PM
  3. cascade combo boxes in continous forms
    By storm1954 in forum Forms
    Replies: 3
    Last Post: 05-10-2012, 06:00 AM
  4. Sub-Sub Form Cascade Combo Boxes
    By Huddle in forum Access
    Replies: 4
    Last Post: 03-22-2012, 01:42 PM
  5. Working of Combo boxes in Form
    By suryaprasad in forum Forms
    Replies: 3
    Last Post: 06-29-2011, 11:54 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