Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox filter help

Status
Not open for further replies.

LysaTigger

Technical User
Jan 28, 2005
12
CA
Hi,
I am making a map request database in which the map maker must record the information for the map request. My problem is concerning the location.

Right now I have one listbox for the continent, country, and province. The country listbox is filtered by whatever continent is slected in the continent listbox, and the province listbox is filtered by whatever is selected in the continent and country listboxes.

Unfortunately, the map may contain more than one continent and more than one province, thus I must select more than one value in the list box. Although when I change the multi select option to simple or extended the country and province listboxes go blank.

Can anyone help me,
Lysa
 
Yes...once you set a list box to Multi Select to Simple or Extended, the List Box no longer has a value itself. You must then write some code to get the "items selected". Usually folks write the selected items to a temp table. You can look in HELP or search the forums here for the code to do that--it's pretty straight forward.

However, I'm not sure if this will end up being the solution you want. I don't know if it will take too long to run that code, or if deleting and appending new list box selections to a table (or tables, in your case) will bloat the db too much. I guess you can always just continually compact it....

So, let me ask you this: are you saving the selected information to a table? If so, how were you planning on saving the info for multi-selected continents and/or provinces? You'd need code for that too. But maybe your set up should be this (I'm guessing on your process):

Table: MapRequests
Field: MapRequestID (Autonumber)
Field: Requestor (text)
Field: RequestDate (Date)

Table: MapRequestDetails
Field: MapRequestID (Number, from table MapRequests)
Field: ContinentID
Field: CountryID
Field: ProvinceID

So, then you'd have a form based on the table MapRequests.
You'd have a subform embedded on that form, based on MapRequestDetails.

On the subform, you'll have three combo boxes, each with row sources of the three tables of Continents, Countries and Provinces and Control Sources of ContinentID, Country ID, and ProvinceID. The master/child links will be MapRequestID.

The subform will be in datasheet format.
Then set up the combo box row sources to feed off of each other, like you did with your list boxes (countries of selected continent, provinces of selected countries).

This way people can choose multiple provinces for each request.

Any of this appeal to you?


Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top