Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining multiple fields into one programmatically

Status
Not open for further replies.

lolitek

Technical User
Jan 6, 2002
3
US
Current fields:
fname 1
lname 1
fname 2
lname 2
fname 3
lname 3

Resulting fields will be:
fname 1 and lname 2 --->MainAuthor

all the rest --->Authors

Any assistance on doing this smoothly via code would be appreciated.
 
Not sure how complicated you want it. I would imagine you are combining them in a separate fields say "mainauthor"/"rest"

[mainauthor] = [fname1] & " " & [lastname]
[rest] = ..... following the same convention as above.

Or declaring a variable as a string

Dim mnauth as string

mnauth = [fname1] & " " & [lastname]

 
Put this in SQL view of query (delete anything else)

SELECT fname1 & " " & lname1 AS MainAuthor, fname2 & " " & lname2 & ", " & fname3 & " " & lname3 AS Authors FROM Your_Table

No need for programming
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top