HI...Im researching for how to auto filter the text box while im typing inside it (ex. I type A in the VB textbox and all records that have letter A will appear dropdown and as I proceed typing Am all records that have Am will appear dropdown) plzzzzzzzzzzzzzz..... any one can give me some code how to do this in my VB 6.0 project....Im using sql as my database!
I will be thankful if any one will reply!thnx....
11 6900
HI...Im researching for how to auto filter the text box while im typing inside it (ex. I type A in the VB textbox and all records that have letter A will appear dropdown and as I proceed typing Am all records that have Am will appear dropdown) plzzzzzzzzzzzzzz..... any one can give me some code how to do this in my VB 6.0 project....Im using sql as my database!
I will be thankful if any one will reply!thnx....
Use the query like - strSql = "Select <Field Names> from <Table Name> where <Search Field> like '" & strSearchText & "%'"
... auto filter the text box while im typing inside it (ex. I type A in the VB textbox and all records that have letter A will appear dropdown and as I proceed typing Am ...
I'm guessing you must be referring to a listbox or something of that sort? A textbox can only display one thing at a time.
Hi,
use a ComboBox, It can Act as both TextBox and a ListBox. Write the Code in KeyPresss event, to populate the Combo..
REgards
Veena
Combo Box is not good for huge list because that will not automatically show the list and we should add 3 to 30 items (Static Data).
We have to use programmatically adding items in ‘List Box’ or ‘List view’ with ‘Text Box’ combination.
Hi hari,
what is this " we should add 3 to 30 items (Static Data)"....?
Why do we need to add Static Data...?
I always prefer TextBox + ListBox Combination with "Sorted" property of the ListBox =True. Since he said he wants to type, I suggested ComboBox
REgards
Veena
HI...Im researching for how to auto filter the text box while im typing inside it (ex. I type A in the VB textbox and all records that have letter A will appear dropdown and as I proceed typing Am all records that have Am will appear dropdown) plzzzzzzzzzzzzzz..... any one can give me some code how to do this in my VB 6.0 project....Im using sql as my database!
I will be thankful if any one will reply!thnx....
Hey friend
use a frame named 'framepartdet'
put MSFlex grid named 'searchgrid' on 'framepartdet' with three columns, fixed rows 2 - Private Sub txtcode_Change() 'event
-
Dim i As Integer
-
If rsstock.State = adStateOpen Then rsstock.Close
-
Dim ccode As String
-
If txtcode.Text = "" Then ' text box value
-
framepartdet.Visible = False
-
Exit Sub
-
End If
-
ccode = Trim(txtcode.Text)
-
rsstock.Open "select distinct code,name from table where field like '" & ccode & "%' ", cn, adOpenDynamic, adLockOptimistic
-
If Not rsstock.EOF And Not rsstock.BOF Then
-
framepartdet.Visible = true
-
rsstock.MoveFirst
-
i = 0
-
searchgrid.Rows = 1
-
Do While Not rsstock.EOF
-
With searchgrid
-
.TextMatrix(i, 0) = i+1
-
.TextMatrix(i, 1) = "" & rsstock.Fields(0)
-
.TextMatrix(i, 2) = "" & rsstock.Fields(1)
-
i = i + 1
-
.Rows = .Rows + 1
-
End With
-
rsstock.MoveNext
-
Loop
-
Else
-
framepartdet.Visible = False
-
End If
-
rsstock.Close
-
End Sub
* link removed *
Hi hari,
what is this " we should add 3 to 30 items (Static Data)"....?
Why do we need to add Static Data...?
I always prefer TextBox + ListBox Combination with "Sorted" property of the ListBox =True. Since he said he wants to type, I sujjested ComboBox
REgards
Veena
we should add 3 to 30 items (Static Data)"....?
That is not exact count (that is approximate).
Static Data - I mean which will change the list index during key press or key up event.
thanks!for your reply but i can't get it...can u plz instruct me the step by step method on how can I make a textbox searching in vb6 using my sql database!sorry for being slow...Im only a noob in VB6...
Hi hari,
what is this " we should add 3 to 30 items (Static Data)"....?
Why do we need to add Static Data...?
I always prefer TextBox + ListBox Combination with "Sorted" property of the ListBox =True. Since he said he wants to type, I suggested ComboBox
REgards
Veena
Hi QVeen72
tnx for the response...can you teach me how to use combobox in filtering?ex.when I type A all names starting A will appear and if i type Ab all names with Ab appear and the names with the letter A but without b will disappear!how can I do that?
tnx for the response...can you teach me how to use combobox in filtering?ex.when I type A all names starting A will appear and if i type Ab all names with Ab appear and the names with the letter A but without b will disappear!how can I do that?
Hey friend
use a frame named 'framepartdet'
put MSFlex grid named 'searchgrid' on 'framepartdet' with three columns, fixed rows 2 - Private Sub txtcode_Change() 'event
-
Dim i As Integer
-
If rsstock.State = adStateOpen Then rsstock.Close
-
Dim ccode As String
-
If txtcode.Text = "" Then ' text box value
-
framepartdet.Visible = False
-
Exit Sub
-
End If
-
ccode = Trim(txtcode.Text)
-
rsstock.Open "select distinct code,name from table where field like '" & ccode & "%' ", cn, adOpenDynamic, adLockOptimistic
-
If Not rsstock.EOF And Not rsstock.BOF Then
-
framepartdet.Visible = true
-
rsstock.MoveFirst
-
i = 0
-
searchgrid.Rows = 1
-
Do While Not rsstock.EOF
-
With searchgrid
-
.TextMatrix(i, 0) = i+1
-
.TextMatrix(i, 1) = "" & rsstock.Fields(0)
-
.TextMatrix(i, 2) = "" & rsstock.Fields(1)
-
i = i + 1
-
.Rows = .Rows + 1
-
End With
-
rsstock.MoveNext
-
Loop
-
Else
-
framepartdet.Visible = False
-
End If
-
rsstock.Close
-
End Sub
* link removed *
Hi syamas
tnx for the response...can you teach me how to use combobox in filtering?ex.when I type A all names starting A will appear and if i type Ab all names with Ab appear and the names with the letter A but without b will disappear!how can I do that?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jonas L |
last post by:
Hi,
I need to create a textbox which acts as a normal textbox but with the
following extra requirements:
1) In-focus color, when the textbox gets focus the backcolor property
of the textbox...
|
by: Rodrigo DeJuana |
last post by:
Howdy,
I'm new to this .net stuff and really have little to no training. Im trying
to create a new page for a web form, so i have been pretty much jsut coping
code. I having some issue with...
|
by: Newasps |
last post by:
Hi guys,
I have a problem with UpdateCommand Event. In tihs event Ä°'m creating required controls to get that controls' values and also get them. But when I try to get updated values I'm getting the...
|
by: I am Sam |
last post by:
I have a DataGrid that is passing information to a stored procedure properly
but the parameters aren't being casted properly. I was woundering if anyone
can tell me how I should properly cast the...
|
by: Mamatha |
last post by:
Hi
I want to add an icon to the textbox's text.
I don't know how to display icon in textbox in VB.NET.
If any one knows please let me know.
Thanks in advance.
Mamatha
|
by: Brad Rogers |
last post by:
All,
Being immersed in vb.net and trying CSharp after almost a year I forgot the
differences. I like vb fixing the uppercase/lowercase names and seeming to
be more flexible to code entry.
...
|
by: Jacob Donajkowski |
last post by:
Once the user logs in I want to have the users switch from the Roster
View to the Profile View and enter their profile infomation and save
it. Then the next time they login and go to the Profile...
|
by: Marco Pais |
last post by:
Hi there.
How can I change the background color of a textbox when it gets the focus?
I can handle the "Enter" event and do this
private void txtDummie_Enter(object sender, EventArgs e) {
...
|
by: Andy B |
last post by:
I have this code:
protected void EditEventsWizard_NextButtonClick(object sender,
WizardNavigationEventArgs e) {
//get the values from the DetailsView
TextBox StartTime =...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |