Solved

Number Search in combo box of  vsflexgrid.

Posted on 2001-08-01
7
986 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
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.

 
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

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
change vba from autofit to 13.5 width? 4 28
Access query that references subform 5 43
MsgBox 4 45
VB 6 error 5 in windows 10 but not in XP 7 42
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 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…

911 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

21 Experts available now in Live!

Get 1:1 Help Now