Solved

Number Search in combo box of  vsflexgrid.

Posted on 2001-08-01
7
1,017 Views
Last Modified: 2007-12-19
Hi,

I am creating one accounting application.
In the application i have purchase screen wherein user can purchase number of product in an order.
To show Products in purchase order i have used vsflexgrid.
In vsflexgrid user can add/modify the products.

Now i have one problem,
I am having combo box in first columns of vsflexgrid, combo box shows all the product number available in database.
Let us say i have product numbers like 1,10,11,2,23,50,100, etc.
Combox box in vsflexgrid shows all these product number.

When typing in the grid, autofill works when I type a 1 it brings up
Product 1 and when I type a 5 it brings up item 50 but when I type 10 it doesn't bring up anything.

What i need is if user type 10 then the combo box of the grid should show number 10, etc.

Any help in this regards will be highly appreciated.


Thanks in advance.


Sudarshan


0
Comment
Question by:sudarshan_shir
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 5

Expert Comment

by:KDivad
ID: 6343980
In the Form's Gen. Dec. section, add:

Private SkipChange As Boolean

In the combobox's change event, compare what the user has typed:

Dim I As Long
Dim X As Long
X = Len(Combo1.Text)
For I = 0 To Combo1.ListCount - 1
    If Left$(Combo1.List(I), X) = Combo1.Text Then
        Combo1.Text = Combo1.List(I)
        Combo1.SeLStart = X
        Combo1.SelLength = Len(Combo1.Text)
        Exit For
    End If
Next

And in the KeyDown event:

If KeyCode = vbKeyBack Then SkipChange = True


This is the same basic idea I use for an auto-complete combobox.
0
 
LVL 5

Accepted Solution

by:
KDivad earned 100 total points
ID: 6343986
Forgot a part:

.......
X = Len(Combo1.Text)
If SkipChange Then Exit Sub
For I = 0 To Combo1.ListCount - 1
.......
0
 
LVL 5

Expert Comment

by:KDivad
ID: 6343987
One more time:

.......
X = Len(Combo1.Text)
If SkipChange Then
    SkipCahnge = False
    Exit Sub
End If
For I = 0 To Combo1.ListCount - 1
.......
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:KDivad
ID: 6343990
You've got to be getting tired of this. <sigh>

SkipCahnge = False

should be:

SkipChange = True
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6344401
Do you have the ComboSearch property set to flexCmbSearchAll ? I think that if you choose one of the other settings it affects the way the searching works.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7198390
Hi sudarshan_shir,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept KDivad's comment(s) as an answer.

sudarshan_shir, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7213213
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

615 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