Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Related combos - don't work!
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01519661
Message ID:
01519679
Views:
47
This message has been marked as a message which has helped to the initial question of the thread.
Hi Naomi,


SELECT - SQL has problem with corectly evaluating THIS and THISFORM.
Yes, you can use varibale, but the variable must be PUBLIC (visible for control on form).

Or another solution...
* cboDepartments::InteractiveChange
thisform.cboCategories.rowsource = "select * from csrCategories where department = SPACE(10) or department = '"+This.Value+"' into cursor csrCat"
thisform.cboCategories.Requery()
MartinaJ

>Hi everybody,
>
>This should be very simple, but for some reason doesn't work for me.
>
>I have two combos on the form, one is Departments, another is Categories.
>
>I want Categories to depend on Departments.
>
>So, this is what I tried to set as Categories combo rowsource, but when I try to select records from Categories I got variable cDepartment not found:
>
>with thisform.cboDepartments
>   .rowsourcetype = 2
>   .rowsource = 'csrDepartments'
>   .BoundColumn = 2
>   .listindex = 1
>endwith
>with thisform.cboCategories
>   .rowsourcetype = 3
>   .rowsource = "select * from csrCategories where department = SPACE(10) or department = ?m.cDepartment into cursor csrCat"
>   .listindex = 1
>   .BoundColumn = 2
>endwith
>
>In department's Interactive Change I set this private variable and requery the combo. Only when I touch categories combo I got an error.
>
>I tried originally using thisform.cSelDepartment instead of department = ?m.cDepartment, but it also didn't work - I was getting an error I can not use a method - something along these lines.
>
>I guess I will have with re-building the combo's source every time, e.g. rowsource = '', select, requery.
>
>What do you think?
>
>Thanks in advance.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform