Solved

DBDataList Control

Posted on 1999-01-23
2
211 Views
Last Modified: 2013-12-25
   I have an Access database that I have bound through an ADO control to a DataList box.  I'm trying to display two of the columns in this list box with a dash in between them.  The code to display just one of the columns is:
 
datalist1.listfield = "Country"
 
The "Country" is one of the column names in this table and when executed, it lists the elements of that column.  Do you have any suggestions as to how I can simply list the elements of two columns with a dash in between them?  
0
Comment
Question by:akedah
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 100 total points
ID: 1499391
Your ADO control have to return both fields you want alreaady concatenate toghether.

Select Field1 + ' - ' + Field2 AS FieldToDisplay
From TableX
0
 

Author Comment

by:akedah
ID: 1499392
It took me a while to figure out that I needed to code a SQL statement and since I didn't have a SQL book that dealt with VB, it took me a bit longer to get the correct syntax.  Thank you so very much for your help!!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now