VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This code lists the data from a field in the combo Box

by Ts Bhusal (3 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 28th July 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This code lists the data from a field in the combo Box

API Declarations


'Create a database with a Name "Database.mdb"
'make a field "Students" in the database. You can make others also
'in a form, draw a combo box and a command button
'draw a datacontrol in the form

Rate This code lists the data from a field in the combo Box



with data1
  .databasename=App.path & "\database.mdb" 'or C:\database.mdb; path
   .recordsource="Select Students From Database" ' or "Students"
  .refresh
end with
end sub

Private Sub Form_Load()
on error resume next
Do Until data1.recordset.EOF
combo1.additem data1.recordset.fields("Students")
data1.recordset.movenext
loop
End Sub

Download this snippet    Add to My Saved Code

This code lists the data from a field in the combo Box Comments

No comments have been posted about This code lists the data from a field in the combo Box. Why not be the first to post a comment about This code lists the data from a field in the combo Box.

Post your comment

Subject:
Message:
0/1000 characters