Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

DBDataList Control

Posted on 1999-01-23
2
221 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 70

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 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