473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

concatenate records

jpr
hello,

I have a form with four fields: Fname, Lname, DOB and txtresult.

Examples: JOHN, SMITH, 03/19/2006.

The first three are bound to a table while the txtresult is unbound.

I would like to associate a code that returns to the txtresult the
following information:

txtresult=

JOHN SMITH was born on 03/19/2006.

Is there a way to do this and where to add the code? Basically I need
to concatenate several records in one field and add some text between
them.

Thank you.

Mar 19 '06 #1
4 2156
Remove txtResult from the table.

Instead, create a query, and type this into a fresh column in the Field row:
Result: [Fname] & " " & [Lname] & " was born on " & [DOB] & "."

More info in:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"jpr" <jp***@tin.it> wrote in message
news:11*********************@z34g2000cwc.googlegro ups.com...
hello,

I have a form with four fields: Fname, Lname, DOB and txtresult.

Examples: JOHN, SMITH, 03/19/2006.

The first three are bound to a table while the txtresult is unbound.

I would like to associate a code that returns to the txtresult the
following information:

txtresult=

JOHN SMITH was born on 03/19/2006.

Is there a way to do this and where to add the code? Basically I need
to concatenate several records in one field and add some text between
them.

Thank you.

Mar 19 '06 #2
jpr
thanks for you reply. Unfortunately I don't want to create another
query since my form is based on a query and I need to txtresult as it
can be used by users to add any other data they want .

My idea was to allow users to save time in having to write into the
the unbound text box.

Is there a way I can do it simply by code?

Mar 19 '06 #3
jpr wrote:
thanks for you reply. Unfortunately I don't want to create another
query since my form is based on a query and I need to txtresult as it
can be used by users to add any other data they want .

My idea was to allow users to save time in having to write into the
the unbound text box.

Is there a way I can do it simply by code?

You were close in your first post. You wrote
txtresult=JOHN SMITH was born on 03/19/2006

Why not put in the ControlSource of txtresult
=[FirstName] & " " & [Lastname] & " was born on " & [BirthDate]

That would be similar to making a hard coded field as the control source
="JOHN SMITH was born on 03/19/2006"

Mar 19 '06 #4
If you are saying that you want the text field to default to that value, but
users can change it, you could use the AfterUpdate event of the 3 fields to
assign the text to the result field.

The article I pointed you to explains when and how to do that.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"jpr" <jp***@tin.it> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
thanks for you reply. Unfortunately I don't want to create another
query since my form is based on a query and I need to txtresult as it
can be used by users to add any other data they want .

My idea was to allow users to save time in having to write into the
the unbound text box.

Is there a way I can do it simply by code?

Mar 20 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Big Time | last post by:
I've got a crosstab query that counts the number of values in one of my tables. However, rather than giving me the number of instances of each record, what I would like is for each value to...
8
by: Dixie | last post by:
I have the results of a query to send to a mailmerge with Word 2000. The query produces say 6 to 8 records, where only 1 of the fields is different from record to record. I can only have one...
2
by: Kevin | last post by:
Hello, How do I concatenate two fields in the same table... For example, I have two tables, first one is called familynametable that has a familyID and familyname field. This table is connected...
6
by: Sheldon | last post by:
Hi, I am trying to build a large array using concatenate function in python. So as I loop over the number of arrays, of which there are 12 (4 down and 3 across), I create 3 long arrays by...
2
by: perryche | last post by:
Bear with me since I know very limited knowledge about VBA and Module... I have a table Employees, where I build a query out of based on TeamID=1, Therefore, only listed those employees that...
4
by: Dan | last post by:
Hi all, I am creating a search table where the keywords field is made up of several text fields and this is causing me some problems. I can concatentate the text ok but i can't seem to concatenate...
6
by: drazenj | last post by:
Hi , sorry for my english ... I work in high school as a teacher and try to make CLASS SCHEDULE (TIME schedule) for my collegues and for students . My problem is that I don't know how to...
1
by: rafnavsun | last post by:
Hi Everybody, I need to concatenate all records on one field as one line. Example: Field 1 has 50 records, record1, record2 to record50. I need to display an output in Text that read as: ...
10
by: Aaron Hoffman | last post by:
Hello, I'm hoping someone might be able to offer some guidance to my problem. I have one query in MS Access which consists of 2 tables joined by a SEQUENCE_ID. By joining the two tables I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.