>First, I posted a similar message yesterday regarding this same subject, thanks for the responses. Unfortunately, I am still haven't been able to get it to work. I'm sure the problem is me. Anyway, I'll elaborate a little more and maybe I'll get it this time. I have a form with a combo box and a list box. I have a list of unique categories listed in the combo box. I need the list box to update and refresh with the devices for the category picked in the combo box when a device category is selected in the combo box.
>
>I am using VFP3 only because this is a WIN95 and MAC application. From what I gather I should be able to set the RowSource to a SELECT statement, the RowSourceType to 3 - SQL Statement and call the Requery method when my selection changes in the combo box.
Assuming the ControlSource for the combobox is category table field(s):
Create a parameterized view in the database, such as
CREATE VIEW vueCategoryDevices AS ;
SELECT * FROM devices WHERE devices.category=category.category
Ensure that the view is in the dataenvironment.
Set the ControlSource for the listbox to the fields in the view you want to see.
Set NoDataOnLoad property of the view to .T.
In Form.Init, put =REQUERY('vueCategoryDevices')
In Combobox.InteractiveChange put the same requery and then a THISFORM.ListBox.Refresh()
This will do it!
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05