Hi All
My query is very simple.
I have a data file with two fields only in EXCELL.( Fields are Name and Address)
1. Import this file in MSACCESS 2007.
2. Creat a Form in VB2008 Express edition.
3. Fetch the data from database file.
4. How to distribute/install this newly created programme to other computers by using Windows Installation tool.

I wish the form should be such that if first few characters of any name from the Name field of Database file is written in a text box the address for that specific name is displayed in other text box. I require procedure as well as coding for this.

Thanks in advance.

Edited by drmangeshajoshi

3 Years
Discussion Span
Last Post by kRod

You could use a ComboBox control with the autocomplete items filled with your names. Then, as the users type into the box, a drop down will appear with the possible names. (Make use of the comobox's SelectedValueChanged event.

For example:

Private Sub FillComboBox(ByVal dt As DataTable)
        'Clear the combobox

        'Fill the lookup as well
        Dim acSC As New AutoCompleteStringCollection

        If dt.Rows.Count > 0 Then
            For Each dr As DataRow In dt.Rows
                ComboBox1.Items.Add(dr("Name")) 'Place the name of the 'NameColumn' from the database inside the quotes.
                acSC.Add(dr("Name")) 'Same here

            With ComboBox1
                .AutoCompleteCustomSource = acSC
                .AutoCompleteMode = AutoCompleteMode.SuggestAppend
            End With
        End If
    Catch ex As Exception
    End Try
End Sub
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.