Question

VFP 6 Drop-down Search?

Asked by: cafulford

Hi, I am completely new to VFP and have been asked to look at some code that was written years ago and try to add drop down search capability. In this case it will be when a user starts typing in the product #, a box appears below the entry that lists all of the products that begin with the first entry, then narrow accordingly as the user types additional digits. I have included a .jpg of another application to show what I mean.

I know practically nothing about VFP 6 so the more detailed you could be the more helpful.

Thanks in advance for any help that is given.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-10-14 at 11:29:10ID24812330
Tags

Visual Foxpro

,

VFP

,

Microsoft VFP

Topic

FoxPro Database

Participating Experts
1
Points
500
Comments
5

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. VFP 6 - jpg
    I have an employee table (1,200 employees). Using a digital camera, would like to add the photo of the employee to the form. How is this done and how can I get the image to display automatically going from record to record (not having to double click on the jpg icon). Also...
  2. jpg in VFP 5
    Does anyone know how to display jpg files on a form in VFP 5?
  3. How to scan documents within VFP
    I want to scan documents using VFP, is it possible? Thanks...
  4. VFP 6.0/Castelle Faxpress
    We have just started using faxpress as our fax server and it is very impressive. I now want to use the SDK. In particular, SubmitFax.exe which should make faxing from VFP seamless. I am able to use submitfax.exe from a command prompt but am having no success at all from with...
  5. Inserting a Jpg impage on a label in VFP 8
    I have created a label form in VFP 8. I inserted a JPG image on to the albel as a color logo. The image does not have any lines around it on screen or when printed from other MS programs like WORD and Excel. However - when I print the labels I see a line around hte left side...
  6. From foxpro2.5 to VFP 7....
    I have a pretty big applcation running under Foxpro 2.5 DOS. the customer is still happy with that but I am not since maintaining this application is becoming harder and harder... (it is a multi user application. 25 users with a pretty large tables--- 4 of them are around 800...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: AndrewJenPosted on 2009-10-14 at 11:37:52ID: 25573613

The control that you want is a Combobox in VFP-speak.

Set the IncrementalSearch property to .t. (true).

The above will partially satisfy your request by positioning the cursor on the item that most closely matches the typed characters.

To narrow the contents of the dropdown requires more code...

 

by: cafulfordPosted on 2009-10-15 at 07:05:11ID: 31641235

Thanks Andrew for pointing me in the right direction.

 

by: cafulfordPosted on 2009-10-15 at 07:31:39ID: 25580892

Andrew,

I have figured out where the code is and played around with a combobox in the visual designer. It currently looks like a text box is prompting for a product #, then they do a direct lookup on that product # and display the product # info. Below is the code. Does this look like something that can be easily changed to a combobox or should I try from scratch?

Thanks,

Charlie

Set Exact on

WkProdId = UPPER(Alltrim(thisform.txtProdID.value))

WkLabelName = "Unknown"

If Len(WkProdId) < 1
    Thisform.imgCSALogo.Visible = .F.
    Thisform.txtSize.value = ""
    Thisform.txtComponent1.value = ""
    Thisform.txtComp1_Mat.value = ""
    Thisform.txtComponent2.value = ""
    Thisform.txtComp2_Mat.value = ""
    Thisform.txtComponent3.value = ""
    Thisform.txtComp3_Mat.value = ""
    Thisform.txtMax_Wgt.value = ""
    Thisform.txtMax_Force.value = ""
    Thisform.txtMax_elongate.value = ""
    Thisform.txtMax_Fall.value = ""
    Thisform.txtMin_Break.value = ""
    Thisform.txtCSA_Class.value = ""
    Thisform.txtProd_desc.value = ""
    Thisform.txtGeneralMsg.value = "* P R O D U C T   N U M B E R    E R R O R *"
    WkLabelName = ""
    Thisform.txtD_Ring.value = ""
    Thisform.txtLabel_Fmt.value = ""
    Thisform.txtCSA_Std.value = ""
    Thisform.txtCSA_Logo.value = ""
    Thisform.txtANSI_Std.value = ""
    Thisform.txtOSHA_Std.value = ""
**
    cMessageTitle = '* * * * * * * * * * *     Safewaze Labeling    * * * * * * * * * * *'
    cMessageText = '      Blank Product Number...Do you want to EXIT?'
    nDialogType = 4 + 32 + 0
*  4 = Yes and No buttons
*  32 = Question mark icon
*  0 = First button is default

    nAnswer = MESSAGEBOX(cMessageText, nDialogType, cMessageTitle)
    If nAnswer = 6    && 7 = they pressed No button     (The Yes button is 6)
        Clear EVENTS
        Close ALL
        Thisform.Release
        Return
    Endif
Return

Endif

Use M:\Easy32\data\sw_prod.dbf Shared
Set ORDER TO TAG prod_id OF M:\Easy32\data\sw_prod.cdx IN sw_prod
Go Top
NoProductFound = "N"
Seek(WkProdId) IN sw_prod

If NOT Found()
    Use
    Use M:\Easy32\data\sw_prod.dbf Shared
    Set ORDER TO TAG prod_id_2 OF M:\Easy32\data\sw_prod.cdx IN sw_prod
    Go Top
    Seek(WkProdId) IN sw_prod
    If NOT Found()
        NoProductFound = "Y"
    ENDIF
Endif

If NoProductFound = "Y"
    Thisform.imgCSALogo.Visible = .F.
    Thisform.txtSize.value = ""
    Thisform.txtComponent1.value = ""
    Thisform.txtComp1_Mat.value = ""
    Thisform.txtComponent2.value = ""
    Thisform.txtComp2_Mat.value = ""
    Thisform.txtComponent3.value = ""
    Thisform.txtComp3_Mat.value = ""
    Thisform.txtMax_Wgt.value = ""
    Thisform.txtMax_Force.value = ""
    Thisform.txtMax_elongate.value = ""
    Thisform.txtMax_Fall.value = ""
    Thisform.txtMin_Break.value = ""
    Thisform.txtCSA_Class.value = ""
    Thisform.txtProd_desc.value = ""
    WkLabelName = ""
    Thisform.txtD_Ring.value = ""
    Thisform.txtLabel_Fmt.value = ""
    Thisform.txtCSA_Logo.value = ""
    Thisform.txtCSA_Std.value = ""
    Thisform.txtANSI_Std.value = ""
    Thisform.txtOSHA_Std.value = ""
**
    Thisform.txtGeneralMsg.value = "* P R O D U C T   N U M B E R    E R R O R *"
    cMessageTitle = '- -  E R R O R  - -'
    cMessageText = 'Product Number not found on file...'
    nDialogType = 0 + 64 + 0
    nAnswer = MESSAGEBOX(cMessageText, nDialogType, cMessageTitle)
    Thisform.txtGeneralMsg.value = "* P R O D U C T   N U M B E R    E R R O R *"
    Return
Endif


* 06/15/2009 Added below to show CSA logo based on new SAP Classification field CAF
        If sw_prod.csa_logo = "Y"
            Thisform.txtCSA_Logo.value = "Y"
            Thisform.ImgCSALogo.Visible = .T.
        Else
            Thisform.txtCSA_Logo.value = "N"
            Thisform.ImgCSALogo.Visible = .F.
        Endif
* 06/15/2009 End CAF

Thisform.txtGeneralMsg.value = ""
Thisform.txtSize.value = sw_prod.size

Thisform.txtComponent1.value = sw_prod.Component1
Thisform.txtComp1_Mat.value = sw_prod.Comp1_Mat
Thisform.txtComponent2.value = sw_prod.Component2
Thisform.txtComp2_Mat.value = sw_prod.Comp2_Mat
Thisform.txtComponent3.value = sw_prod.Component3
Thisform.txtComp3_Mat.value = sw_prod.Comp3_Mat

Thisform.txtMax_Wgt.value = sw_prod.Max_Wgt
Thisform.txtMax_Force.value = sw_prod.Max_Force
Thisform.txtMax_elongate.value = sw_prod.Max_elong
Thisform.txtMax_Fall.value = sw_prod.Max_Fall
Thisform.txtMin_Break.value = sw_prod.Min_Break
Thisform.txtCSA_Class.value = sw_prod.CSA_Class
Thisform.txtProd_desc.value = sw_prod.prod_desc
WkLabelName = sw_prod.label_fmt
Thisform.txtLabel_Fmt.value = sw_prod.label_fmt
Thisform.txtD_Ring.value = sw_prod.d_ring
Thisform.txtCSA_Std.value = sw_prod.csa_std
Thisform.txtANSI_Std.value = sw_prod.ansi_std
Thisform.txtOSHA_Std.value = sw_prod.osha_std

Use

 

by: AndrewJenPosted on 2009-10-15 at 07:44:03ID: 25581039

You will likely be better off going from scratch - mostly because of the rowsource and rowsourcetype properties that are required in the combobox and not present in the text box example. Certainly the code that you have attached will provide some pointers!

I have a class that I spent quite a bit of time on in the past that I will try to dig up a little later and pass along to you for your use and/or study. It does more of what you are after...

Thanks for the grading Charlie!

Andrew

 

by: cafulfordPosted on 2009-10-15 at 09:23:20ID: 25582164

Hi Andrew,

That would be great if you would pass on the training materials. I would really appreciate it.

I have another question:

I got a combobox to work using the builder just to see how it would behave and as you said, it is not exactly as the users requested and it does not appear like it would work for us. Is there a way with coding that it could work exactly as I had hoped?

Another thought - what about a textbox as it stands now but with a pop-up list via a key-press, that could pass the selection to the text field?

Thanks,

Charlie

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...