Hi,
So I have been browsing around and I haven't been seen what I'm looking for.
Ultimately, I am using the selections made of the form to generate a query for the user.
I have a CITIES listbox that is populated with values from a stored query.
I would like to make it multi-select and populate a LOCATIONS list box and a NAMES list box based upon the CITIES that are selected.
I have the locations currently populated from a stored query that reads the City selection from the Form. It looks like this
I also want multi-select so that is you can un-select all and get the results for all cities.
Here is my half thought approach.
^ I intended to have the variable LocQryStr as the row source but I abandoned the idea of having multi-select when I saw that .Selected(I) never returned true. Its like the values aren't read in this subroutine.
Its possible I may have been unclear about something please let me know if this is true.
Any help will be greatly appreciated
So I have been browsing around and I haven't been seen what I'm looking for.
Ultimately, I am using the selections made of the form to generate a query for the user.
I have a CITIES listbox that is populated with values from a stored query.
I would like to make it multi-select and populate a LOCATIONS list box and a NAMES list box based upon the CITIES that are selected.
I have the locations currently populated from a stored query that reads the City selection from the Form. It looks like this
Code:
SELECT DISTINCT (t_location.LOCATION) AS Expr1
FROM t_location INNER JOIN t_asset_master ON t_location.LOCATION_PHY_ID = t_asset_master.LOCATION
WHERE (((t_location.CITY)=[Forms]![MasterQueryGenerator]![CityList]));
Here is my half thought approach.
Code:
Private Sub CityList_AfterUpdate()
'Dim LocQryStr As String
'Dim r As Integer
'Dim ctl9 As Control
'LocQryStr = "SELECT DISTINCT (t_location.LOCATION) " & _
' "FROM t_location INNER JOIN t_asset_master ON t_location.LOCATION_PHY_ID = t_asset_master.LOCATION " & _
' "WHERE (((t_location.CITY)=" & _
' LocQryStr & [Forms]![MasterQueryGenerator]![CityList].OnSelect()));
'Set ctl9 = [Forms]![MasterQueryGenerator]![CityList]
'For i = 0 To [Forms]![MasterQueryGenerator]![CityList].ListCount - 1
' If [Forms]![MasterQueryGenerator]![CityList].Selected(i) Then r = r + 1
'Next i
'REQUERY THE LOCATION LIST TO SHOW LOCATIONS IN THE SELECTED CITY
Me.LocationList.Requery
End Sub
Its possible I may have been unclear about something please let me know if this is true.
Any help will be greatly appreciated
