Results 1 to 13 of 13
  1. #1
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121

    Cascading combo box error

    I get an Error Parameter value in main form, however subform works perfectly. What do I need to do in main form for this to work? What I am doing is getting behaviors based on category selected with an after update as follows:



    Private Sub Behavior_AfterUpdate()

    End Sub


    Private Sub Category_AfterUpdate()
    Behavior.Requery
    End Sub

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    You don't explain much about what's where, but at a minimum, I'd never use Behaviour.Requery as Behavior is probably being interpreted as a field.
    Use Me.Behavior.Requery
    Always provide the parent reference in one way or another.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    I added the Me. to the Behavior in After Update event on the subform and when I view the subform it still works fine. However, I get the same Error Parameter message on main form. I would be happy to share my simple database if you would like to see what is where.

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    you can post a compacted/zipped copy of your db any time you see fit. Sometimes, if the problem is simple and the issue well explained it's faster to just explain everything completely and clearly. Or explain the "error" message and post the rest of the relevant code (best to provide an error number and some/all of the text. Numbers alone are not very helpful.

    It may be that you're trying to run a query and pass a form control value to it and you're getting an error message regarding a missing parameter. Or you could be getting an input box for a missing parameter. They're not the same thing.
    Last edited by Micron; 04-30-2019 at 11:49 AM. Reason: clarification

  5. #5
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    ok here is the zipped dbase. On the subform called frmBehaviorsSubform the Behavior is what I am trying to populate based on Category selected combo box which is the first item on the form. It works on the subform when I view it. When I go to the main form frmAssessment the Enter Parameter message comes up. I'm very novice so I may be very off base on table/query setup. our help is much appreciated!
    Attached Files Attached Files

  6. #6
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Have to step out for a while. Someone else will likely beat me to it in the meantime.

  7. #7
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,821
    Hi

    Your problem is that you have 1 table for BOTH Category and Behaviours.

    You need to use 2 tables, One for the Categories and 1 for the Behaviours.

    When you select a Category using 1 Combobox a Second Combobox would only display those Behaviours associated with the Category selected. Known as Cascading Combobox's.

    See the example in the attached.
    Attached Files Attached Files

  8. #8
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I would suggest you take a step back and review your design.

    - You have spaces in object names
    - You have special characters in object names.
    - You have "ID" as the PK field name for the majority of tables.
    - You have repeating fields in table "AssessmentDetail". This should be in a separate table. What happens in you want to add "ErrorPrecursor4" and "ErrorPrecursor5"? Answer is - you will have to redesign your whole dB.
    - You don't have the 2 lines that should be at the top of every code module:
    Code:
    Option Compare Database
    Option Explicit
    - You could use your existing table "CategoryBehaviors", but you would need cascading comb boxes.


    My $0.02............

  9. #9
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    Thanks for all the input. Mike60smart, I looked at the file you sent back and have the following questions/observations: 1. When I add a new line to the frmAssessment, the behaviors from the previous lines disappear. when I go back to the first line, and select the Behaviors drop down the associated Behaviors for the last line appear. 2. Previously, when I selected the drop down for error precursors, both the Error Code and the Description appeared, and now they do not even though column count is 2 and column widths are still set. 3. The Yes/No field is no longer putting a check in the box. If you could take a look at these items, I would sure appreciate.

  10. #10
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,821
    Hi

    I believe you are not understanding the process.

    in the modified db attached I added a Search Combobox to select an Assessment Date. Also a Command Button to add a New Assessment Date.

    You select the Category and then select the Behaviors

    When you move to a new Assessment date you then add the values required in the subform

    Hope this helps
    Attached Files Attached Files

  11. #11
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    Let me rephrase 1. Within an Assessment when a new ID No/row is added and the Category is selected, the Behaviors for previous ID No's within the same Assessment seem to disappear. 2. Previously, when I selected the drop down for error precursors, both the Error Code and the Description appeared, and now they do not even though column count is 2 and column widths are still set. 3. The Yes/No field is no longer putting a check in the box. If you could take a look at these items, I would sure appreciate.

  12. #12
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,821
    Sorry I have given you an example of cascading Combobox's which work.

    What you want to happen with other controls you are not explaining very well.

    Take note of all the other comments and rectify before proceeding.

  13. #13
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    thank you, cascading combo box error solved

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

Similar Threads

  1. Replies: 2
    Last Post: 05-30-2018, 05:08 PM
  2. Cascading-Combo box
    By kiranair in forum Forms
    Replies: 4
    Last Post: 07-28-2016, 01:04 AM
  3. Replies: 7
    Last Post: 05-23-2014, 08:39 AM
  4. Replies: 1
    Last Post: 02-27-2014, 03:43 PM
  5. Cascading combo box
    By Plix in forum Access
    Replies: 1
    Last Post: 02-20-2013, 06: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