Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 2nd, 2003, 10:30 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: , Kent, United Kingdom.
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
Default Combo Boxes

Hi

I usually use a Sheridan Data Combo Box that has a datafieldlist property where you enter the field that will populate the combo box. I no longer have the facility to use Sheridan Data Combo, so I am using a normal combo box, but it does not have this property, can you please tell me where this is as it is populating the combo box with only the first record of the dataset. I have also tried a while loop with add items to the combo box, but this is also not working either.

Thanks in advance

Louisa

Reply With Quote
  #2 (permalink)  
Old September 9th, 2003, 01:22 PM
Registered User
 
Join Date: Sep 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Franklin66
Default

Hi Louisa...!
Try making a recordset with the data that you need from database... then do a Until EOF ... loop to feel the combo box using the additem method
Do Until rsRecordset.EOF
cboBox.AddItem rsRecordset!fildname
rsRecordset.MoveNext
Loop



Reply With Quote
  #3 (permalink)  
Old September 10th, 2003, 09:26 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: , , .
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Louisa,

I don't think a regular combo box has this property. I have populated combo box before with something like this.

Dim adoCon as ADODB.Connection
Dim adoRst as ADODB.Recordset
Dim strConnect

'Open a DB connection
set adoCon = New ADODB.Connection
strConnect "sample connection string"
adoCon.open

'Open a recordset
set adoRst = New ADODB.Recordset
adoRst.open "My SQL Query Or Table",adoCon

'check to make sure the recordset has information
If not adoRst.eof and not adoRst.bof then
   'loop through the recordset
   Do until adoRst.eof
      'add the item
      combo1.addItem adoRst.fields.item("myField").value
      'move top the next item
      adoRst.MoveNext
   Loop
End If

Set adorst = nothing
Set adoCon = Nothing
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo Boxes nbuckwheat Access 1 January 15th, 2006 09:26 AM
3 combo boxes ttkt Beginning PHP 0 July 2nd, 2005 02:20 PM
Combo boxes socoolbrewster Access 1 March 4th, 2004 09:28 AM
Combo Boxes tjs206 VB Databases Basics 2 December 10th, 2003 05:20 PM
combo boxes damnnono_86 Access 2 October 15th, 2003 09:00 PM



All times are GMT -4. The time now is 11:58 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.