Solved

Number Search in combo box of  vsflexgrid.

Posted on 2001-08-01
7
979 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
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 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

18 Experts available now in Live!

Get 1:1 Help Now