Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox and Filter
Message
From
23/12/2004 07:26:16
 
 
To
23/12/2004 07:03:57
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00971725
Message ID:
00971740
Views:
17
Marcia

I have used your code of valid combo method, but when I click on the list box appear the message "This can only be used within a method".

The difference is that my list box BoundColumn = 2 and the field that I am using as filter is numeric.


>Is not possible to filter records on listbox? I am trying but the filter does not work properly.
>
>Yes, it is possible to filter records in a listbox. You said that your RowSourceType was 6-Fields, but you did not give us any other information.
>
>This example gives you an idea of you can set it up :
>
>
>DEFINE CLASS form1 AS form
>	DoCreate = .T.
>	Caption = "Form1"
>	Name = "Form1"
>
>	ADD OBJECT list1 AS listbox WITH ;
>		BoundColumn = 1, ;
>		ColumnCount = 2, ;
>		ColumnWidths = "150", ;
>		RowSourceType = 6, ;
>		RowSource = "customer.company,country", ;
>		Height = 121, ;
>		Left = 75, ;
>		Top = 87, ;
>		Width = 258, ;
>		Name = "List1"
>
>
>	ADD OBJECT combo1 AS combobox WITH ;
>		RowSourceType = 6, ;
>		RowSource = "country.country", ;
>		Height = 24, ;
>		Left = 76, ;
>		Top = 25, ;
>		Width = 220, ;
>		Name = "Combo1"
>
>
>	PROCEDURE combo1.Valid
>		LOCAL lcFilter
>		SELECT Customer
>		lcFilter = [country = '] + ALLTRIM( this.Value  ) + [']
>		SET FILTER TO &lcFilter
>		GO TOP
>		Thisform.List1.Requery()
>	ENDPROC
>
>
>ENDDEFINE
>
Antonio Carlos Kleinübing
Systems Analyst
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform