by Victor Francisco Cajarito (3 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Fri 6th August 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
SQL Statement, Select all Distinct Record on a Table and populate it on ComboBox or ListBox. Any Additional Code Send it to my E-mail...
Data1.Recordsource = "SELECT DISTINCT <Field> FROM <TableName>" 'Filter Fields with a unique Name
Data1.Refresh ' Refresh The Table
While Not Data1.Recordset.EOF
Combo1.AddItem Data1.Recordset("Field") 'Field on SELECT
Data1.Recordset.MoveNext ' View all Field Content
Wend
End Sub
'Note U can use (ListBox or ComboBox)
'U can also code it on CLICK Event and KEYPRESS Event
No comments have been posted about SQL Statement, Select all Distinct Record on a Table and populate it on ComboBox or ListBox. Any Ad. Why not be the first to post a comment about SQL Statement, Select all Distinct Record on a Table and populate it on ComboBox or ListBox. Any Ad.