Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can i make filter in a combo?
Message
 
 
To
12/07/2006 09:01:56
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01135646
Message ID:
01135661
Views:
9
>I am trying to make a filter with 2 comboxes and a 2 cursors for example the cursor 1 is the rowsource of the combo 1, the cursor 2 is the rowsorce of the combo 2, i want to make a filter in the combo 2 with the combo 1 value. for example if the combo 1 value is 'city 1' so the combo 2 display only the data with a 'city 1' relation. i can do when i am making a new register but when i am trying to modify the register created with this method sometimes do but sometimes display my combo 2 clear without registers. this is a example of my code:
>
>&&This is the gotfocus method of my combo2:
>
>if !empty(combo1.value)
>	set exact off
>	set near on
>	select subclases1 &&cursor 2, the cursor 1 is filling the combo 1
>	go top
>	set filter to subclases1.clase=k_clase && public variable
>	locate for subclases1.subclase=val(thisform.nsubclase) &&form property
>	this.value=thisform.nsubclase
>else
>	select subclases1
>	set filter to subclases1.clase=k_clase
>endif
>set exact on
>set near on
>thisform.refresh
>
>i can make the filter only is i am makin a new register, but modifying not.

What are rowsources for your comboboxes? Can you make them to be select-SQL or cursors?

When in the first combobox valid you would write something like:
local lcCity
if not empty(this.value)
  lcCity = alltrim(this.value)
   with this.parent.cboOther
          .Rowsource = ""
         select Field1, Field2 from myTable where City = m.lcCity into cursor curOther nofilter
        .RowSource = "curOther"
  endwith
endif
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform