Solved

filter a combo box vfp

Posted on 2010-11-26
3
2,322 Views
Last Modified: 2012-05-10
Hi:
It would be nice to see a history of stocks we have ordered.
So I have a form with a combo list of 150 stock items; and a grid of the order table.
Selecting a stock code from the combo reveals in the grid all the orders for that item.
But I would like to filter the combo. Every stock item is in a group ('type' in the stock table).
It would be nice to filter the combo so that just the items for the type required is displayed.
So I created a table (called "type") of the types. On the form I put a list box of the types, joined to the stock table. I hoped that selecting a type from the type list box would filter the combo to that type...but it does not. The filter stills calls up all 150 products.
Is it possible to filter the combo to the value selected in the list box?
Thanks!
0
Comment
Question by:ClaytonGlass
  • 2
3 Comments
 

Author Comment

by:ClaytonGlass
ID: 34216714
I have added this to the dropdown method of the combo box:
SET FILTER TO type = thisform.List1.Value
THISFORM.Refresh
but get an error:
"THISFORM can only be used in a method".
I thought it was!
0
 
LVL 41

Accepted Solution

by:
pcelba earned 125 total points
ID: 34217270
The FILTER expression is valid anywhere the table remains open it means even outside the form.

If the thisform.List1.Value is of a character data type then you may define the filter following way:

lcFilter = thisform.List1.Value
SET FILTER TO type = "&lcFilter"

The filter must be set in the Listbox - you may use e.g. Valid method.

Depending on the Combo RowSourceType you would probably have to call combo's Requery() method after the filter change.
0
 

Author Closing Comment

by:ClaytonGlass
ID: 34217481
Thanks!
I had in fact kind of got there myself (a first for me!) but thanks anyway!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Foxpro, Word 2003 Automation and Windows 7 10 878
Import CSV Files 5 1,097
VFP automation fails after upgrade to Word 2010 18 502
Print a word document in Visual Foxpro 1 550
Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
A customer recently asked me about anti-malware and the different deployment options available for his business. Daily news about cyberattacks, zero-day vulnerabilities, and companies that suffered a security breach made him wonder if the endpoint a…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now