473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

As VB index help

I like the feature in the VB index help, that user types in first
serveral characters, the list will jump to the first match.
How can i do this in VB with the combination of a combo box
and list box or with the combination of a text box and list box ?
Is this possible ? What events must i use for this ?
Any idea is acceptable .
Thanx !
Feb 15 '07 #1
10 1065
What are you trying to do? You can do this so a combobox itself. So is
there some particular reason you want to do it with two controls?

Robin S.
-----------------------------------
"giannis" <zz********@freemail.grwrote in message
news:%2******************@TK2MSFTNGP06.phx.gbl...
>I like the feature in the VB index help, that user types in first
serveral characters, the list will jump to the first match.
How can i do this in VB with the combination of a combo box
and list box or with the combination of a text box and list box ?
Is this possible ? What events must i use for this ?
Any idea is acceptable .
Thanx !

Feb 16 '07 #2
RobinS wrote:
You can do this so a combobox itself.
How can i do this with a combo box ?
Feb 16 '07 #3
RobinS wrote:
You can do this so a combobox itself.
You mean the DropDownStyle Property ?
Feb 16 '07 #4
"giannis" <zz********@freemail.grwrote in message
news:OG**************@TK2MSFTNGP03.phx.gbl...
RobinS wrote:
> You can do this so a combobox itself.
How can i do this with a combo box ?
giannis,

Here's an example.

On the combobox:
Set AutoCompleteMode to SuggestAppend.
Set AutoCompleteSource to CustomSource.

'this loads my combobox and binds it
Private Sub LoadManagerComboBox()
If MgrList IsNot Nothing AndAlso MgrList.Count 0 Then
MgrList = Nothing 'blank out the table
End If
'create the list that is going to be bound to the combobox
'this could just as easily be a datatable
MgrList = PTBO.ManagerList.Create(ManagerName)
'bind the combo box to the list
ManagerComboBox.DataSource = MgrList
ManagerComboBox.DisplayMember = "FullName"
ManagerComboBox.ValueMember = "UserID"
ManagerComboBox.SelectedIndex = -1
Call BuildAutoCompleteStrings()
End Sub

'this builds the autocomplete strings
Private Sub BuildAutoCompleteStrings()
'If the manager list doesn't have any entries, return.
If MgrList.Count <= 0 _
OrElse ManagerComboBox.Items.Count <= 0 Then
Return
End If
' Clear what is in there now
ManagerComboBox.AutoCompleteCustomSource.Clear()
'Set the column name.
Dim filterField As String = "FullName"
' Build the list of filter values.
Dim filterVals As AutoCompleteStringCollection = _
New AutoCompleteStringCollection()
For Each dataItem As Object In MgrList
Dim props As PropertyDescriptorCollection = _
TypeDescriptor.GetProperties(dataItem)
Dim propDesc As PropertyDescriptor = _
props.Find(filterField, True)
Dim fieldVal As String = _
propDesc.GetValue(dataItem).ToString()
filterVals.Add(fieldVal)
Next
' Set the list on the collection.
ManagerComboBox.AutoCompleteCustomSource = filterVals
End Sub
Good luck,
Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.

Feb 16 '07 #5
RobinS wrote:
Here's an example.
I am a newbie at VB.
I dont understand all these ...
What ebooks you suggest me to read ?
I care about build a program with a mdb database in VB.
(I dont care about SQL servers databases)
Thank you for your care and sorry about my english !!!
Feb 16 '07 #6
If you are using Access instead of SQL, you just use the OLEDBDataAdapter
instead of SQLDataAdapter, OLEDBCONnection instead of SQLConnection,
OLEDBCommand instead of SQLCommand (are you getting the pattern here?).

I don't use Access as a back-end any more, so I don't know what books that
is covered in. Dave Sceppa talks about it in his ADO.Net Core Reference
book, but not in detail. I think most everything he talks about for
SQLServer applies to Access, give or take the way it does named parameters
and a few more complicated details.

The example that I posted is binding a combobox to a List(Of Manager)
object and then setting up the autocomplete stuff so when somebody starts
typing into the combobox, it can try to complete their selection.

Do you have *any* prior programming experience, and if so, in what
languages?

Robin S.
-----------------------------------------
"giannis" <zz********@freemail.grwrote in message
news:e1**************@TK2MSFTNGP02.phx.gbl...
RobinS wrote:
>Here's an example.

I am a newbie at VB.
I dont understand all these ...
What ebooks you suggest me to read ?
I care about build a program with a mdb database in VB.
(I dont care about SQL servers databases)
Thank you for your care and sorry about my english !!!

Feb 16 '07 #7
RobinS wrote:
If you are using Access instead of SQL, you just use the
OLEDBDataAdapter instead of SQLDataAdapter, OLEDBCONnection instead
of SQLConnection, OLEDBCommand instead of SQLCommand (are you getting
the pattern here?).
Thanks for your advices !!!
The example that I posted is binding a combobox to a List(Of Manager)
object and then setting up the autocomplete stuff so when somebody
starts typing into the combobox, it can try to complete their
selection.
MgrList = PTBO.ManagerList.Create(ManagerName)

I receive the error PTBO is not declared . What is this ? (PTBO)
I receive the error ManagerName is not declared . Is a string ?
>
Do you have *any* prior programming experience, and if so, in what
languages?
A little VB6 and VBAccess
Feb 17 '07 #8
RobinS wrote:
>If you are using Access instead of SQL, you just use the
OLEDBDataAdapter instead of SQLDataAdapter, OLEDBCONnection instead
of SQLConnection, OLEDBCommand instead of SQLCommand (are you getting
the pattern here?).
When i use the :
Dim adapter As OleDbDataAdapter
i receive the error that is not defined :(
Feb 17 '07 #9
Ok. I added the System.Data.OleDb at refenences.

giannis wrote:
When i use the :
Dim adapter As OleDbDataAdapter
i receive the error that is not defined :(

Feb 17 '07 #10
Read the comments in the code.

'create the list that is going to be bound to the combobox
'this could just as easily be a datatable
MgrList = PTBO.ManagerList.Create(ManagerName)

Robin S.
--------------------------------
"giannis" <zz********@freemail.grwrote in message
news:e0**************@TK2MSFTNGP06.phx.gbl...
RobinS wrote:
>If you are using Access instead of SQL, you just use the
OLEDBDataAdapter instead of SQLDataAdapter, OLEDBCONnection instead
of SQLConnection, OLEDBCommand instead of SQLCommand (are you getting
the pattern here?).

Thanks for your advices !!!
>The example that I posted is binding a combobox to a List(Of Manager)
object and then setting up the autocomplete stuff so when somebody
starts typing into the combobox, it can try to complete their
selection.

MgrList = PTBO.ManagerList.Create(ManagerName)

I receive the error PTBO is not declared . What is this ? (PTBO)
I receive the error ManagerName is not declared . Is a string ?
>>
Do you have *any* prior programming experience, and if so, in what
languages?

A little VB6 and VBAccess

Feb 18 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jofio | last post by:
Hello, I am a newbie in PHP and I am enthusiastically trying out things. I've just replaced my index.html ( file with index.php
4
by: PhilC | last post by:
Hi Folks, If I have an array holding a pair of numbers, and that pairing is unique, is there a way that I can find the array index number for that pair? Thanks, PhilC
2
by: David Schwartz | last post by:
We are having quite a time since moving a large database to a new server (actually built new server, renamed as old to make seamless for users, etc.) Import 104 million row database (5 column)...
6
by: Anita | last post by:
I have just tested 3 queries using QA. The complete test information : ------ CREATE TABLE agls1 ( fyear char(4) NULL , fprefix char(3) NULL , fvcno char(20) NULL , fdate datetime NULL ,...
1
by: Stephane Charette | last post by:
QUICK VERSION: How do I create an index on a field of type "MONEY"? ----------------------------- LONG VERSION: I have a table with a field of type "money". I very often need to access...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
11
by: Santosh | last post by:
Dear all , i am writting following code. if(Page.IsPostBack==false) { try { BindSectionDropDownlist();
18
by: Dave | last post by:
Guys I am really stuck on this one. Any help or suggestions would be appreciated. We have a large table which seemed to just hit some kind of threshold. They query is somewhat responsive when...
0
by: Michiel Overtoom | last post by:
SUBHABRATA wrote... Yes, you can. There is only a difference when the string is not found: the 'find()' function will return -1, whereas 'index()' function will raise a ValueError exception....
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.