I assume you are already working with a database, so here is a basic layout to try. I am using ADO with this code:
Hope this helpsCode:Private Sub Command1_Click() Dim rs As New Recordset Dim csql As String csql = "SELECT * FROM table where " & Combo1.Text & " LIKE %" & Text1.Text & "%" rs.Open csql, db, adOpenForwardOnly, adLockReadOnly End Sub Private Sub Form_Load() Dim rs As New Recordset Dim csql As String csql = "SELECT * FROM table" rs.Open csql, db, adOpenForwardOnly, adLockReadOnly Dim i As Integer For i = 0 To rs.Fields.Count - 1 Combo1.AddItem rs.Fields(i).Name Next End Sub




Reply With Quote