473,394 Members | 1,739 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,394 software developers and data experts.

concatenated form fields

Hello Group,

I have 2 text fields that I would like to concatenate for use in a table.
One field is an ordinary text box. The other is a simple combo box which I
use to select one of about ten items.

The ordinary text field is: NewLongDescription
(This is a memo field that contains descriptions of dolls sold in an e-comm
site)

The combobox is: Default Hair Color
It gets information from a table called: DefaultHairColorTable
(this table contains various hair colors for dolls)

I thought I could just type the following in the LongDescription text box in
the design view:
LongDescription=[NewLongDescription]&" "&"Stock Hair Color (if any):"&"
"&[Default Hair Color]

but the form displays: #Name?

What am I missing?

I hope you can help shed some light on what i am doing wrong.

Thanks
~Bruce
Nov 12 '05 #1
2 2364
B Love wrote:
Hello Group,

I have 2 text fields that I would like to concatenate for use in a table.
One field is an ordinary text box. The other is a simple combo box which I
use to select one of about ten items.

The ordinary text field is: NewLongDescription
(This is a memo field that contains descriptions of dolls sold in an e-comm
site)

The combobox is: Default Hair Color
It gets information from a table called: DefaultHairColorTable
(this table contains various hair colors for dolls)

I thought I could just type the following in the LongDescription text box in
the design view:
LongDescription=[NewLongDescription]&" "&"Stock Hair Color (if any):"&"
"&[Default Hair Color]

but the form displays: #Name?

What am I missing?

I hope you can help shed some light on what i am doing wrong.

Thanks
~Bruce

Buce;

As control source in an UNBOUND control:

=[NewLongDescription] & " " & "Stock Hair Color (if any): " & [Default
Hair Color]

NOT..
LongDescription = [NewLongDescription] etc.

Notice I've also simply added the space after "(if any): "
to avoid the extra & " " & you have used.

Make sure the name of the control is not the same as the name of any
field used in it's control source expression. If you use an unbound
control (as I have suggested above) whenever you use an expression you
will not have any problem.
If you convert the control source of a bound control, and neglect to
change the control name, you will get an error,)

I don't know what you mean when you say you want to 'concatenate for use
in a table.'

Calculated data, (meaning concatenated in this instance) should NOT be
saved in any table. Whenever you need the concatenated text, just
re-concatenate it, in a form, a query, or in a report, as above.

--
Fred
Please reply only to this newsgroup.
I do not respond to personal e-mail.
Nov 12 '05 #2

"fredg" <fg******@example.invalid> wrote in message
news:e0**********************@bgtnsc05-news.ops.worldnet.att.net...
B Love wrote:
Hello Group,

I have 2 text fields that I would like to concatenate for use in a table. One field is an ordinary text box. The other is a simple combo box which I use to select one of about ten items.

The ordinary text field is: NewLongDescription
(This is a memo field that contains descriptions of dolls sold in an e-comm site)

The combobox is: Default Hair Color
It gets information from a table called: DefaultHairColorTable
(this table contains various hair colors for dolls)

I thought I could just type the following in the LongDescription text box in the design view:
LongDescription=[NewLongDescription]&" "&"Stock Hair Color (if any):"&"
"&[Default Hair Color]

but the form displays: #Name?

What am I missing?

I hope you can help shed some light on what i am doing wrong.

Thanks
~Bruce
Buce;

As control source in an UNBOUND control:

=[NewLongDescription] & " " & "Stock Hair Color (if any): " & [Default
Hair Color]

NOT..
LongDescription = [NewLongDescription] etc.

Notice I've also simply added the space after "(if any): "
to avoid the extra & " " & you have used.

Make sure the name of the control is not the same as the name of any
field used in it's control source expression. If you use an unbound
control (as I have suggested above) whenever you use an expression you
will not have any problem.
If you convert the control source of a bound control, and neglect to
change the control name, you will get an error,)

I don't know what you mean when you say you want to 'concatenate for use
in a table.'

Calculated data, (meaning concatenated in this instance) should NOT be
saved in any table. Whenever you need the concatenated text, just
re-concatenate it, in a form, a query, or in a report, as above.

--
Fred
Please reply only to this newsgroup.
I do not respond to personal e-mail.


Fred:

Thanks for the tip. After I took some spaces out of the "DefaultHairColor"
field and implemented the mod you suggested, I was able to make a calculated
(concatenated) field. I my application I really needed to make this
calculated field a field that would be recorded to the underlying table.
With some minor VB coding, I was able to accomplish this. I realize that in
most circumstances this is probably not the proper way to build a database,
but honestly, it was appropriate in this case.

If you are interested, here is what I did:

When either NewLongDescription or DefaultHairColor lost focus, the following
now occurs:

Private Sub DefaultHairColor_LostFocus()
Me!DefaultHairColor.Requery
Me![LongDescription] = Me![ConcatDescript]
End Sub

Private Sub NewLongDescription_LostFocus()
Me!NewLongDescription.Requery
Me![LongDescription] = Me![ConcatDescript]
End Sub

The result is that the calculated (unbound) field (ConcatDescript) gets
loaded into a bound field called LongDescription when either of the two user
entry fields lose focus after an update (NewLongDescription or
DefaultHairColor). Bottom line is that it works (is loaded into the
underlying table). One thing I want to add to the code ( which I am unsure
just how to do) is to test yet another field to see if the product line is
one of several types and based on the results, either concatenate with:

=[NewLongDescription] & " " & "Stock Hair Color (if any): " &
[DefaultHairColor]

or (because the other products do not have hair) concatenate as follows:
=[NewLongDescription] & " "

As an example, my ProductLine field has several lines of dolls including
Lizzie High. ProductLine also include Lizzie's Cottage Furniture (which
definitely do not have hair). So I can distinguish between the lines that
would and wouldn't have hair options and therefore I should be able to use
some sort of branch to implement appropriately.
Since my VB is not all that good, maybe you or someone else in here might
have some ideas?

Thanks again Fred!
~Bruce
Nov 12 '05 #3

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

Similar topics

7
by: M Wells | last post by:
Hi All, I have what seems to me to be a difficult query request for a database I've inherited. I have a table that has a varchar(2000) column that is used to store system and user messages...
5
by: Tim Jarvis | last post by:
Hi, I posted this earlier in the databinding group, but that group appears to be pretty dead. Is it possible to bind a combo box to a table, but have a DisplayMember that is a concatenation...
4
by: Kurt | last post by:
I'm using the fConcatChild function posted at http://www.mvps.org/access/modules/mdl0004.htm to return a field from the Many table of a 1:M relationship into a concatenated string. The function...
1
by: Jeff Silverman | last post by:
I have a PHP program that almost works. I'm running it from the command line and simulating a form using a GET method. That part is working, but I get spurious records with all of the fields...
7
by: eric.goforth | last post by:
Hello, I'm working with a classic asp page that calls another classic asp page. The html in my calling page looks like: <form method="post"...
1
by: e_marquess | last post by:
This should be simple but it has me stumped. I have two fields First_Name and Last_Name. I want to search for John Smith by entering "John", "Smith" or "John Smith". I have tried to...
1
by: Brad Isaacs | last post by:
Using ASP.NET 2.0 with SQL Server 2000 Inside my dropdown list box I am using an SQL DataSource to select the following data SELECT RTRIM(c.Name_First) + ' ' + RTRIM(c.Name_Last) AS Contact,...
3
by: nfrjob | last post by:
Hi there, I'm an advanced beginner, so please bear with me... I have a simple table that has four fields in it: Zone (which will store a three letter code such as ABC), Year (a four digit number...
8
by: banderson | last post by:
Hello, I have a combo box in which I want to display multiple fields by concatenating the fields together. If one of those concatenated fields is Null, then the combo box does not show anything. To...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.