VB3: Setting listbox based on value of other listbox 
Author Message
 VB3: Setting listbox based on value of other listbox

I am attempting to populate a listbox based on the selected item of
another listbox.  I have attempted to use a Parameter Query, but have
been unsuccessful.  Below is the portion of my code.  Is it just that
VB3 cannot set the recordsource of a data control to a parameter query
or am I missing something.  Also, it this the best way to go about it?

    'the index holds the StateID
    stateid = listState.ItemData(listState.ListIndex)

    sqry = "PARAMETERS stateid integer; "
    sqry = sqry & "SELECT fldCityID, fldCityName FROM tblCitys "
    sqry = sqry & "WHERE fldStateID = stateid ORDER BY fldCityName"
    dataCitys.RecordSource = sqry

It is on the Refresh that I keep getting '1 parameter were expected,
but only 0 were supplied.  I guess I could put an If statement within
my Do loop to test before I do an 'AddItem' but that would seem to
slow the process even more.

Thanks in advance for any assistance.


Wed, 08 Jul 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Setting the value of the listbox to null

2. Retreive Value from Listbox/Set Focus

3. Setting default value of listbox on ASP webpage

4. Setting Listbox values

5. Combobox or Listbox: separting key values from display values

6. Run Query based on Listbox results - text parsing?

7. Query based on multiple selection listbox

8. opening form based on multiselect listbox!

9. Listbox display based on textbox entry...

10. Asp - Data based on a listbox

11. Newbie: Updating an image field/object box based on selection in a ListBox

12. Sorting a Listbox based on ItemData property


Powered by phpBB® Forum Software