Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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 November 17th, 2004, 12:57 AM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Populate Combo Box

I need to populate a combo box into 3 columns not just one as shown below
I will appreciate any assistance

While Not rs.EOF
cbo2.AddItem (rs.Fields(0) & " " & rs.Fields(1) & " " & rs.Fields(2))
If rs.EOF Then
GoTo Exitna
End If
rs.MoveNext
Wend

Many thanks
Phil

Reply With Quote
  #2 (permalink)  
Old November 17th, 2004, 04:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Norwich, Norfolk, United Kingdom.
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can't you use a combo box bound to the original table/query from which rs is derived? Then you can use the Column Count property.

Clive Astley
Reply With Quote
  #3 (permalink)  
Old November 18th, 2004, 01:59 AM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

clive, thanks , but I wantd to populate from a recordset run from a sql query . I have now got the answer, I had left out the semicolons between the rs.fields()

cbo2.AddItem (rs.Fields(0) & ";" & rs.Fields(1) & ";" & rs.Fields(2))

all the best
Phil.t
Reply With Quote
  #4 (permalink)  
Old November 18th, 2004, 03:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Norwich, Norfolk, United Kingdom.
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Phil. Glad you got the answer. And I have learnt something too - I wouldn't have thought of the semicolons. So, thanks.

Best wishes,

Clive Astley
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
Populate a text box from a combo box value dnf999 Access VBA 7 February 6th, 2012 02:24 PM
Populate a combo box from database w/vbscript morituri VBScript 1 March 1st, 2005 07:06 PM
Populate combo box with access db with using ADO neo_jakey Pro VB Databases 1 October 23rd, 2004 10:11 AM
Populate combo box with access db with using ADO neo_jakey VB Databases Basics 3 October 13th, 2004 03:36 PM
Populate List Box by Combo Box Selection mmcdonal Access 2 June 15th, 2004 12:08 PM



All times are GMT -4. The time now is 01:25 PM.


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