this.comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;
I get the following error - "Value of type 'System.Windows.Forms.Auto
'IN-FORM CODE:
Private Sub frmOfficiant_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Officiants = New Officiants
Dim blankOfficiant As New Officiant 'this is provided for the user to add a new officiant if need be
Officiants.RefreshFromDatabase()
Officiants.Insert(0, blankofficiant)
With Me.cboOfficiantLastName
.DataSource = Officiants
.DisplayMember = "LastName"
.AutoCompleteMode = AutoCompleteMode.SuggestAppend
.AutoCompleteCustomSource = AutoCompleteSource.ListItems
End With
End Sub
'-----------------------------------------------
'COLLECTION CLASS OF CUSTOM CLASS
Public Class Officiants
Inherits System.ComponentModel.BindingList(Of Officiant)
'the following three subs allow this class to know when a
'new item is inserted, added, or the list is changed.
Protected Overrides Sub InsertItem(ByVal index As Integer, ByVal item As Officiant)
MyBase.InsertItem(index, item)
End Sub
Protected Overrides Sub OnAddingNew(ByVal e As System.ComponentModel.AddingNewEventArgs)
MyBase.OnAddingNew(e)
End Sub
Protected Overrides Sub OnListChanged(ByVal e As System.ComponentModel.ListChangedEventArgs)
MyBase.OnListChanged(e)
End Sub
Public Sub RefreshFromDatabase()
Dim strsql As String = _
"SELECT officiant_id, title, first_name, " & _
" last_name, address1, address2, " & _
" city, state, zip, " & _
" phone " & _
"FROM Officiant " & _
"--where --ADD WHERE STATEMENT HERE "
Dim drItems As SqlClient.SqlDataReader
drItems = DataSrc.GetDataReader(strsql)
'clear current list
MyBase.Clear()
'cycle through all items and add to list
While drItems.Read
Dim x As New Officiant
x.OfficiantId = CInt(NullToZero(drItems("officiant_id")))
x.Title = CStr(NullToBlank(drItems("title")))
x.FirstName = CStr(NullToBlank(drItems("first_name")))
x.LastName = CStr(NullToBlank(drItems("last_name")))
x.Address1 = CStr(NullToBlank(drItems("address1")))
x.Address2 = CStr(NullToBlank(drItems("address2")))
x.City = CStr(NullToBlank(drItems("city")))
x.State = CStr(NullToBlank(drItems("state")))
x.Zip = CStr(NullToBlank(drItems("zip")))
x.Phone = CStr(NullToBlank(drItems("phone")))
MyBase.Add(x)
End While
'close the datareader
drItems.Close()
End Sub
.
.
.