Results 1 to 10 of 10
  1. #1
    Jo22 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Location
    Alberta, Canada
    Posts
    21

    Cascading Combo Boxes Requery Problem

    I have a subform [Quote Query] which has several cascading combo boxes. [cmbProduct] will populate the appropriate list selection for [cmbPattern], which will populate the appropriate list selection for [cmbColor].

    [cmbProduct] has an afterUpdate event - Me![cmbPattern].requery
    [cmbPattern] has an afterUpdate event - Me![cmbColor].requery

    Everything works fine for the first record, but when i go to the next record and change the product, [cmbPattern] goes blank for the first record. I the second record to requery but I want to keep the first record as entered. If I change the product in the second record I should get a new list to select from in [cmbPattern].

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Are your ComboBoxes "bound"? i.e. Do they have a ControlSource?

  3. #3
    Jo22 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Location
    Alberta, Canada
    Posts
    21
    Yes, they are bound.

  4. #4
    Jo22 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Location
    Alberta, Canada
    Posts
    21

    Me.Combobox Requery

    I should mention that the subform is in datasheet view, if that makes any difference.

    As mentioned, I want to requery the current record only. How do I prevent the requery from erasing the data in the first record?

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    A Requery renews an entire Recordset. Have you tried using a Refresh instead?

  6. #6
    Jo22 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Location
    Alberta, Canada
    Posts
    21

    Refresh vs Requery

    Apparently I cannot refresh one record. I tried using Me.Form.Refresh but I just get a runtime error.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try Me.Refresh

  8. #8
    Jo22 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Location
    Alberta, Canada
    Posts
    21

    Me.Refresh

    Unfortunately I get the same results with Me.Refresh - It clears out the data in the preceding record. It will not allow me to have different products in the recordset. It will allow me to change the product and the pattern if I go to a new form, but that does not work because each record set belongs to one order and I need to be able to order more that one product on the same order.

  9. #9
    Jo22 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Location
    Alberta, Canada
    Posts
    21

    Persistence

    AHA! I found the error. I finally thought to take a look at the subforms underlying query to see what's happening in there. I noticed that I wasn't losing the data at all. It just wasn't showing on my form. I knew then that the problem had to be related to the subcontrol names on my form.

    and of course, that was the problem. Somewhere along the way I changed the control name slightly in the table but did not re-select it from the field list on the subform. Because the name change was so close, I did not notice it.

    It's hard to believe how many hours I spent on this problem. A good lesson from the school of hard knocks I guess.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Outstanding. Thanks for posting back with your success and solution.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-22-2012, 10:48 PM
  2. Help with Combo Boxes/requery....etc
    By noaccessguru in forum Forms
    Replies: 9
    Last Post: 06-06-2011, 05:50 PM
  3. Cascading Combo boxes Problem
    By aamer in forum Access
    Replies: 12
    Last Post: 04-03-2011, 07:11 AM
  4. Cascading Combo Boxes
    By gjw1012 in forum Access
    Replies: 1
    Last Post: 07-25-2009, 04:59 PM
  5. Problem with Cascading Combo Boxes
    By CushingMT in forum Forms
    Replies: 0
    Last Post: 11-13-2008, 09:44 AM

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