Results 1 to 3 of 3
  1. #1
    SunTop is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Aug 2016
    Posts
    93

    Cascading combo boxes

    Hello everyone


    I have a form in my database that is supposed to allow the users to alter the fields of a single record of an underlying table. In this form I have two cascading Combo boxes, where the data on the second combo box depends on the data in the first combo box. When the user changes the data in the first combo box, the after update event runs a Requery macro to fetch the new row source values for the second combo box. What happens is that some users change the data in the first combo box and ignores the data in the second combo box, which leaves an unmatched set of data in the underlying table. How to force the user to change the data in the second combo box if he changes the data in the first combo box. I tried setting the validation rule to “is not null”, but that did not work because this is not a new record and there is data in the field.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    in the same event where you run the code to modify the 2nd combo rowsource, add another line of code to set the 2nd combo value to null.(i.e. me.combo2=Null)

    To flag this to the user you can use the 2nd combo format property to show a message when the value is null

    based on the underlying 2nd combo bound column data type

    for text it would be

    @;[Red]"This field must be completed"

    and for numbers

    ;;;[Red]"This field must be completed"

  3. #3
    SunTop is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Aug 2016
    Posts
    93
    Thanks Ajax for your reply,

    It worked perfectly.

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

Similar Threads

  1. cascading Combo boxes
    By Chatholo in forum Forms
    Replies: 2
    Last Post: 08-09-2013, 01:39 AM
  2. Cascading combo boxes
    By Jackie in forum Access
    Replies: 5
    Last Post: 07-26-2013, 09:07 AM
  3. Cascading Combo boxes
    By finsmith in forum Forms
    Replies: 10
    Last Post: 02-12-2013, 09:37 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

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