VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



SQL Statement, Select all Distinct Record on a Table and populate it on ComboBox or ListBox. Any Ad

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...

Rate SQL Statement, Select all Distinct Record on a Table and populate it on ComboBox or ListBox. Any Ad



  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

Download this snippet    Add to My Saved Code

SQL Statement, Select all Distinct Record on a Table and populate it on ComboBox or ListBox. Any Ad Comments

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.

Post your comment

Subject:
Message:
0/1000 characters