Results 1 to 9 of 9
  1. #1
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282

    Cascading Combo Boxes - empty and reliant subforms


    So I had three cascading combo boxes working fine, however I was unsure how to then get text boxes on the form - which relied on the last combo box - to gather data without creating a subform. having given up on that, I did create the subform, however somewhere along the way I broke my cascading combo boxes... your assistance on this is much appreciated.

    The form in question is the "AddAssessmentRecord". When I enter a district into the first field, the following error message appears:
    Click image for larger version. 

Name:	CascadingComboBoxesError.PNG 
Views:	17 
Size:	10.2 KB 
ID:	25647
    When I debug, the following section appears to be the problem:
    Click image for larger version. 

Name:	CascadingComboBoxesErrorDebug.PNG 
Views:	17 
Size:	3.9 KB 
ID:	25648
    I haven't changed any of this code since I made the alteration (there was some more code below it, which referenced the fields now in the subform, but I don't believe this should have affected it.

    When removing the now unnecessary fields from the query, I did accidentally remove the District, Team and Assessor fields, but these have also now been added.

    The reason I have also mentioned the subform in the title/tags, is I am unsure how to then get the subform to use the Assessor's name field as part of its query, you assistance with this will also be much appreciated.

    I have attached my database to assist in your assistance.
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    CboBox =null

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    It's because the query that the form has as its record source (qryAssessmentRecord) is not updatable. The combo box is bound to a field in the query, so the combo box is not updatable either.

    Why would you want to update data in a 5-table query?

  4. #4
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    I changed "Empty" to "Null" as (it appears) you suggested, however I had the exact same response - baring in mind "Team" and "Assessor" are the names of the comboboxes.

  5. #5
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    I only want to update the text in the forms from blank to the details held in the "TblAssessor" - "LiberiID", "Forename" and "Surname" are needed so the user knows which child the assessment is for (and there hasn't been an error meaning it will be applied to a different child), and District and Team are needed to help the user select the assessor (using the cascading comboboxes)

  6. #6
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    If the data in the combo boxes is only for the user's information and is not being saved, then unbind them - remove the reference to a control source.

  7. #7
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    OK, I did that and now it won't let me choose anything in the first dropdown, I just get this error message:
    Click image for larger version. 

Name:	CascadingComboBoxesError.PNG 
Views:	14 
Size:	10.2 KB 
ID:	25662
    Then, when I debug, I get the following area highlighted:
    Click image for larger version. 

Name:	CascadingComboBoxesErrorDebug1.PNG 
Views:	14 
Size:	3.8 KB 
ID:	25664
    Any idea?

    To remove it, I just removed the district and Team tables from the query.

  8. #8
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Did you go into the properties for the Assessor combo box, and delete the value in the Control Source property? It is not the query itself that is causing the problem. The problem is that the combo box is bound to a field in a query that is not updatable, so when you try to change it, you get an error.

    Click image for larger version. 

Name:	01-09-2016 1-23-32 PM.png 
Views:	12 
Size:	15.7 KB 
ID:	25667

  9. #9
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    No... I thought that was needed for the next part, but now that I've thought about it, you're right, it doesn't. Brilliant, thank you!

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

Similar Threads

  1. Cascading Combo Boxes
    By Heathey94 in forum Queries
    Replies: 26
    Last Post: 09-05-2016, 03:02 PM
  2. Cascading Combo boxes
    By finsmith in forum Forms
    Replies: 10
    Last Post: 02-12-2013, 09:37 AM
  3. Replies: 13
    Last Post: 11-17-2011, 01:39 AM
  4. Cascading combo boxes
    By combine21 in forum Forms
    Replies: 3
    Last Post: 12-02-2010, 12:57 PM
  5. Cascading Combo Boxes
    By gjw1012 in forum Access
    Replies: 1
    Last Post: 07-25-2009, 04:59 PM

Tags for this Thread

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