General information
Category:
Forms & Form designer
>I want to filter the items in a combo box based on the value of a different combo box. How can this be accomplished as part of the rowsource SELECT statement without making the variable lcvalue public?
>
>GOTFOCUS METHOD of Combo2
>
>local lcvalue
>lcvalue=This.Parent.Combo1.value
>
>***Since lcValue is local, the filter in the following rowsource will produce an error message once this method is completed.
>
>this.rowsource="sele prefix,imprint2,publisher from publishe into cursor cpublisher1 having publishe.prefix=lcvalue"
>
>this.value=lcvalue
>
>***Using publishe.prefix=this.parent.combo1.value as the filter doesn't work either.
>
>Thanks in advance!
Hi Rixon.
How about adding a custom property to your second combo called cFilter. Initialize it to some value and set up the RowSource as
sele prefix,imprint2,publisher from publishe into cursor cpublisher1 having publishe.prefix=(this.cFilter)
Then, in the When Method of the combo, you can set
this.cFilter = this.parent.combo1.value
and then just
this.Requery()
Marcia
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only