Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 25th, 2003, 12:50 PM
padraig padraig is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Maine, USA
Posts: 16 padraig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Concatonating

Hello, my first post on this site. I have a small procedure in VBA that populates the Row Source of a Combo box in Access 2002.
It works fine, except it is not concatonating the Last name, and First name like I want. I am looking for "Doe, John". What I get is "Doe". Can someone tell me what I'm doing wrong? I have pasted it into the SQL view of a query, and it works. Just not in code. Any help is appreciated since this is driving me mad!

Code:

Private Sub Form_Load()
Dim strActiveSQL As String

If IsNull(Me!AssignedTech.Value) Then
strActiveSQL = "SELECT [EmployeeID], [EmployeeLastName]" & ", " & "[EmployeeFirstName] AS [EmployeeFullName] FROM tblUsers " & _
"WHERE Active = True ORDER BY EmployeeLastName, EmployeeFirstName;"
Else
strActiveSQL = "SELECT [EmployeeID], [EmployeeLastName]" & ", " & "[EmployeeFirstName] AS [EmployeeFullName] FROM tblUsers " & _
"ORDER BY EmployeeLastName, EmployeeFirstName;"
End If

Me!EmployeeName.RowSource = strActiveSQL

End Sub

Reply With Quote
  #2  
Old September 25th, 2003, 01:10 PM
swampBoogie swampBoogie is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2003
Location: Paris Uppland
Posts: 1,773 swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 14 h 30 m 5 sec
Reputation Power: 37
Code:
query = "SELECT [EmployeeID], [EmployeeLastName] & ',' & [EmployeeFirstName] as [EmployeeFullName] ... "

Reply With Quote
  #3  
Old September 25th, 2003, 01:47 PM
padraig padraig is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Maine, USA
Posts: 16 padraig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
A THOUSAND THANK YOU's!!!!!!!!! YOU ROCK! That's been driving me crazy all day!

I get rusty on this stuff. I don't do it very often.

Again....Thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Concatonating


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway