Displaying multiple fields for one record in a combo box
Is there any way to display multiple fields for one record in a combo box? I am designing a form that will utlimately search for street intersections. I am using our intersections layer but unfortunately, there are 5 StreetName fields for each record. You will type StreetName1 in the first AutoCompleteBox and then choose the StreetName that intersects from the list of results in the next ComboBox. Unfortunately, the StreetName you are looking for may not be in the field StreetName2. It may be in StreetName3, 4, or 5. Is there any way to set up a ComboBox that will display more than one field that is equal to the results from the first AutoCompleteBox? I needs it to be something like AutoCompleteBox1 WHERE Street1 LIKE '{0}%' Display Street1 and then ComboBox1 WHERE Street1='{0}' Display Field Street2 AND Street3 AND Street4 AND Street5 Cascading ID AutoCompleteBox1. Any help would be greatly appreciated.
-
The best answer is one you probably won't like - normalize the data at its source. If you create an intersection table where street_id_one and street_id_two represent every intersection, your combo box need only cascade the one time to show every possible intersection. Apply a unique key to both columns and every relationship can be accounted for without repetition.
Alternatively, we have a point featureclass used to identify every intersection. The unique and persistent ID of these points is then related to the unique and persistent ID of every street name that comes together there in a single child table - intersection_street . This allows an unlimited number of street names to be related to any intersection (as opposed to adding a new column when six streets need to intersect - it happens).
In either case, your first combo box selects a valid street from your streets, then the second combo box selects all the valid streets where street_id is in either column of the child table. I suggest creating a database view of the child table joined to the street source to resolve the names and other attributes from the street source. Using this view for the combo box should provide a pretty list for the user to select from.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar