locked
Conditional formatting RRS feed

  • Question

  • Hi,

    I have a database with an order entry form that has multiple lookup fields in it. I would like to have the second lookup window show different choices depending on the selection in the first lookup window.

    The first lookup has 15 "activity" choices.

    If "activity1" is selected, then the second lookup titled "GL Codes" would show only the GL codes linked to "activity1" in a query or table. Is this possible?

    Friday, October 23, 2020 7:29 PM

All replies

  • You might like to take a look at DatabaseBasics.zip in my public databases folder at:

    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

    In this little demo file the section on 'entering data via a form/subforms' includes a simple contacts form in which such correlated combo boxes are used to select a country, then a region and then a city.  Each of the last two is correlated with the control above it in the hierarchy by referencing it as a parameter in the RowSource property.  In the AfterUpdate event procedures of the first tow, the control(s) below in the hierarchy are requeried.

    Note that only the city combo box is bound.  To have region and country columns in the Contacts table would introduce redundancy and the table would not be normalized to Third Normal Form, with the consequent risk of update anomalies.  When the form is at an existing record the two unbound combo boxes are given values by code in the form's Current event procedure which calls GetCountry and GetCity functions in the form's class module.

    Ken Sheridan, Stafford, England


    • Edited by Ken Sheridan Friday, October 23, 2020 8:10 PM Typo corrected.
    Friday, October 23, 2020 8:09 PM
  • This feature is usually done as cascading combo boxes - nothing to do with conditional formatting. 

    You might also like to look at my example app showing how individual UK postcodes can be selected using 5 cascading combos that narrow the search from area to district to sector etc.

    See Cascading Combo Boxes



    • Edited by isladogs52 Saturday, October 24, 2020 7:43 AM Updated link
    Friday, October 23, 2020 9:49 PM