Full Version: Cascading Combo boxes
UtterAccess Forums > Microsoft® Access > Access Forms
newbotanist
I have two questions concerning cascading some combo boxes. The first question is probably the easiest to fix. I have four fields for a plant species form that are as follows: genus, species, svf, and taxon. I've successfully set up cascading combo boxes for all four cells. If I select a genus, then the species within that genus are selected, then svf for that species, and the taxon for that svf. The problem that I'm having is that if I make a mistake in data entry and then enter a new species, the values in taxon remain. I want to set up data entry so that if someone makes a mistake and enter the wrong genus or species that the taxon field is clear. I need help setting that up.
The second question might be more difficult. I have a fifth field, called PSID that I also need to be filled in. PSID is based on the Genus, Species, SVF, and Taxon and represents the Primary key for the species table, which is one source of the data for the form that I'm using. A value in the PSID field would look something like this: Acer rubrum var. drummondii. In this case Acer is the genus, rubrum is the species, var. is SVF, and drummondii is the taxon. I need this field on the form to be filled in automatically, based on the values of genus, species, svf, and taxon are selected. I need the field to be filled in automatically so that someone entering data can tab from taxon to PSID and then the next field over without having to type in any information. Does anyone have any ideas?
RAZMaddaz
Regarding the first question:
When a User changes the species combo box, or any other combo box, you can have one or all the combo box change to clear/empty and then Requery. Say for example you change the species combo box, then in the properties of the species combo box click on the "On Change..." and enter the following:
Me.svf = " "
Me.svf.Requery
Me.taxon = " "
Me.taxon.Requery
newbotanist
Thanks for the help-that solved the first problem pretty definitively.
RAZMaddaz
Regarding the Second question:
nter a text box and in the Properties Control Source combine the fields like the following:
=[genus] & " " & [species] & " " & [SVF] & " " & [taxon]
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.