Yes Steve, that is what I want to do....I figured out a way to do it, my
code is below, a little different from what you suggested though....
        
        '*****************************
        '* Declare and set variables *
        '*****************************
        Dim nWinID, nPos as Integer
        Dim str as String
        nPos = ReadControlValue(1)

        If nPos = 0 Then
                Note "You must select at least one item to continue!"
                Dialog Preserve
        Else
                '*Cycle through the multiselect and create query, and a
table to hold data *
                'nPos = ReadControlValue(1)
                Do While nPos <> 0
                        str = str+","+""""+marrMunicipality(nPos)+""""
                        nPos = ReadControlValue(1)
                Loop
                str=Right$(str,len(str)-1)
                'Note str

                
                '* If the user clicks finish, open the table, display and
zoom to results in                              'the map *
                Dialog Remove
                Run command "Select * from retailcomps_GC where
Geographic_Locations = Any                              ("+str+") into
QueryTable"
                Browse * from QueryTable
                Add Map Auto Layer QueryTable
                nWinId = WindowID(1)
                Set Map
                        Window nWinID
                        Zoom Entire Layer QueryTable
        End If

-----Original Message-----
From: Nabors, Steve [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 04, 2005 2:33 PM
To: Mayer, Mike @ Vancouver
Cc: mapinfo-l@lists.directionsmag.com
Subject: RE: MI-L MultiListBox Values


I'm trying to understand your logic.  Are you wanting to take selections
made in the first multilistbox, put them into a new table, then present only
those values in the new table in the second dialog/multilistbox? 

-----Original Message-----
From: Mayer, Mike @ Vancouver [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 03, 2005 12:55 PM
To: Nabors, Steve
Subject: RE: MI-L MultiListBox Values

Steve,
Thank you for your response, I appreciate the input.  I got it working,
however, in theDescriptionTable, I only get one of the values (the last one)
selected.  Is there a way to add each item selected to the table so they all
appear in the table.  The reason for this is that I have another dialog
which will open up once all the items selected are in a table.  This new
dialog will have multilistboxes that contain values from the columns in the
theDescriptionTable. To further create a custom select.  Am I making sense??
Thanks in advance.
Mike

-----Original Message-----
From: Nabors, Steve [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 03, 2005 10:10 AM
To: Mayer, Mike @ Vancouver
Cc: mapinfo-l@lists.directionsmag.com
Subject: RE: MI-L MultiListBox Values


'Make your RetailMuniHandler Sub do something like the following 'Note that
AnOpenTable is an open table that has a field called Description that has
values in it matching 'marrMunicipality values

dim Pos as integer
Pos = ReadControlValue(1)

'Here we need a loop to hop thru each selection 'Before we do anything,
check to see if they even checked anything, if not, send them back to the
dialog
        If Pos = 0 then
                note "You must check at least one item to continue"
                Dialog Preserve
                'Exit Sub
        Else
                'cycle through the multiselect and load the data
                Do While Pos <> 0
                        Select *
                        From AnOpenTable
                        Where AnOpenTable.Description =
marrMunicipality(Pos)
                        Into theDescriptiontable

                        'Here is where you start building a selection string
or directly doing something
                        'with the item selected in AnOpenTable via
theDescriptionTable
                        'I chose to get a value from the FileName field and
note it
                                Fetch First from theDescriptiontable
                                chosenitem =
Rtrim$(LTrim$(theDescriptiontable.FileName))
                                note chosenitem
                        'reset Pos and loop again               
                                Pos = ReadControlValue(1)
                Loop
                Dialog Remove 
        End If

'hope this helps


-----Original Message-----
From: Mayer, Mike @ Vancouver [mailto:[EMAIL PROTECTED]
Sent: Monday, May 02, 2005 4:06 PM
To: 'mapinfo-l@lists.directionsmag.com'
Subject: MI-L MultiListBox Values

Hello Everyone,
I need some help from all you programmers out there.  I have a MultiListbox
that is populated from an array which reads values from a column in a table.
I need a way to get the values the user selects from the MultiListBox.  I
need to take these values to create a select statement.  I know I must use
the ReadControlValue() function and create a loop to read each item the user
selected. How do I go about doing this?? My code for the dialog, thus far,
looks like this:

'*********************************************************************
'* Function: RetailMuniSelect                                        *
'* Purpose: Pops up a dialog prompting user for which                *
'*          municipality they want to query in the retail comps DB   *
'*********************************************************************
Sub RetailMuniSelect

        
'*********************************************************************
        '** Create a unique list of municipality names, sorted alphbetically
*
        
'*********************************************************************
        Dim m, p as Integer
        Select Geographic_Locations from retailcomps_GC order by
Geographic_Locations group by Geographic_Locations into TMP
        p = TableInfo(TMP, TAB_INFO_NROWS)
        redim marrMunicipality(p)
        for m = 1 to p
                fetch rec m from TMP
                marrMunicipality(m) = TMP.Geographic_Locations
        next

        '***************************************************
        '** Open a dialog to select a muni for retailcomps *
        '***************************************************
        Dialog
                Title "2. Select Municipality"
                Width 210 Height 100
                Control StaticText
                        Title "Municipality: "
                        Position 15, 10
                Control MultiListBox
                        Title from variable marrMunicipality
                        Position 60, 10 Width 100 Height 60
                        ID 1
                Control OKButton
                        Position 65, 80
                        Calling RetailMuniHandler
                Control CancelButton
                        Position 115, 80
                        If Not CommandInfo(CMD_INFO_DLG_OK) Then        
                                Exit Sub
                        End If
End Sub

'***********************************************************
'* Function: RetailMuniHandler                             *
'* Purpose: Handles the OK button for the RetailMuniSelect *
'***********************************************************
Sub RetailMuniHandler

        'Use ReadControlValue() and create a loop to read the values

End Sub

Any input/help is greatly appreciated.

Mike Mayer
(A frustrated GIS Practicum Student.....)



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To
unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16335


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16362

Reply via email to