Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2007, 07:17 PM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Row data in listbox?

I have a question about listboxes and rows in Access tables. I'd like to list data in a specific row of my table in a listbox on a form. I'm basically looking for the same type of result as the "Field List" option in the listbox properties, I just want the list to be values in a row instead of the column names. I'd appreciate some guidance on how this may be accomplished.
 
Old June 8th, 2007, 02:20 PM
Authorized User
 
Join Date: Oct 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Once you've retrieved the row you want from the recordset
using ADO or DAO with a connection/database object, you
can build a string dynamically, something like this:

Dim strValueString As String


strValueString = rst!Name & ";" rst!SSN & ";" rst!Phone
Me.cboComboBox.RowSource = strValueString

Be sure to keep "ValueList" for the RowSourceType

Hope that helps!

Warren





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Several Data Connections for 1 Listbox??? lnickol22 Visual Basic 2005 Basics 3 February 12th, 2008 12:58 PM
Data Binding - Editing GridView Row Data desk_star BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 7 December 30th, 2007 11:07 AM
Deleting selected row in ListBox YoungFools Excel VBA 1 April 19th, 2007 09:14 AM
Row colors in listbox canmex Access 1 November 18th, 2006 09:01 PM
Manage data row by row in datagrid Dragonist Classic ASP Databases 5 July 29th, 2004 04:17 AM





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