473,789 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using CStr on a Memo field

Does using CStr on a memo field truncate it to 255 characters? Seems
like this is happening with some data in my tables. Is there a way
around this?

Oct 22 '06 #1
7 7926
mi********@gmai l.com wrote:
Does using CStr on a memo field truncate it to 255 characters? Seems
like this is happening with some data in my tables. Is there a way
around this?
No. There are numerous things that WILL truncate a memo field to 255
characters, but CStr() is not one of them. Some that will...

Grouping or sorting on it in a query
Grouping or sorting on it in a report
Using DISTINCT (Unioque Values) in a query
Applying a format property in a table or query field or in a Report or form
control

I'm sure there are more.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


Oct 22 '06 #2
Rick has given you his usually excellent answer. I'm just curious as to why
you are using CStr() on a text field?

mi********@gmai l.com wrote:
>Does using CStr on a memo field truncate it to 255 characters? Seems
like this is happening with some data in my tables. Is there a way
around this?
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200610/1

Oct 22 '06 #3
"Rick Brandt" <ri*********@ho tmail.comwrote in
news:yY******** **********@news svr25.news.prod igy.net:
There are numerous things that WILL truncate a memo field to 255
characters, but CStr() is not one of them. Some that will...

Grouping or sorting on it in a query
Grouping or sorting on it in a report
Using DISTINCT (Unioque Values) in a query
Applying a format property in a table or query field or in a
Report or form control

I'm sure there are more.
Er, none of those that I know of will truncate the field. Indeed, if
you try to group or sort or use the DISTINCT operator on a memo
field, it will throw an error.

I've only ever used Left() to truncate memo fields for those
purposes. i.e., to do a sort/group/DISTINCT on a memo when it was
unfortunately required.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Oct 22 '06 #4
"David W. Fenton" <XX*******@dfen ton.com.invalid wrote in
news:Xn******** *************** ***********@127 .0.0.1:
"Rick Brandt" <ri*********@ho tmail.comwrote in
news:yY******** **********@news svr25.news.prod igy.net:
>There are numerous things that WILL truncate a memo field to
255 characters, but CStr() is not one of them. Some that
will...

Grouping or sorting on it in a query
Grouping or sorting on it in a report
Using DISTINCT (Unioque Values) in a query
Applying a format property in a table or query field or in a
Report or form control

I'm sure there are more.

Er, none of those that I know of will truncate the field.
Indeed, if you try to group or sort or use the DISTINCT
operator on a memo field, it will throw an error.
You've obviously not used the dumbed-down recent releases of
Access, which surrepticiously apply the Left(memo,255) without
notification. '97 is the last version not broken by this
stupidity.
I've only ever used Left() to truncate memo fields for those
purposes. i.e., to do a sort/group/DISTINCT on a memo when it
was unfortunately required.


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Oct 23 '06 #5
David W. Fenton wrote:
"Rick Brandt" <ri*********@ho tmail.comwrote in
news:yY******** **********@news svr25.news.prod igy.net:
There are numerous things that WILL truncate a memo field to 255
characters, but CStr() is not one of them. Some that will...

Grouping or sorting on it in a query
Grouping or sorting on it in a report
Using DISTINCT (Unioque Values) in a query
Applying a format property in a table or query field or in a
Report or form control

I'm sure there are more.

Er, none of those that I know of will truncate the field. Indeed, if
you try to group or sort or use the DISTINCT operator on a memo
field, it will throw an error.

I've only ever used Left() to truncate memo fields for those
purposes. i.e., to do a sort/group/DISTINCT on a memo when it was
unfortunately required.
That is true (in Access 97 and older). However; in those versions one could do
all of those things against the first 255 characters of a memo field by using
Left([Field], 255).

In their infinite wisdom MS decided to modify all of the newer versions so that
instead of telling you that those things aren't allowed with memo fields that
just internally truncate all but the first 255 characters automatically. That
decision surely ranks in the top ten as far as the newsgroup questions
generated.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Oct 23 '06 #6
"Rick Brandt" <ri*********@ho tmail.comwrote in
news:zx******** ******@newssvr1 1.news.prodigy. com:
David W. Fenton wrote:
>"Rick Brandt" <ri*********@ho tmail.comwrote in
news:yY******* ***********@new ssvr25.news.pro digy.net:
There are numerous things that WILL truncate a memo field to
255 characters, but CStr() is not one of them. Some that
will...

Grouping or sorting on it in a query
Grouping or sorting on it in a report
Using DISTINCT (Unioque Values) in a query
Applying a format property in a table or query field or in a
Report or form control

I'm sure there are more.

Er, none of those that I know of will truncate the field. Indeed,
if you try to group or sort or use the DISTINCT operator on a
memo field, it will throw an error.

I've only ever used Left() to truncate memo fields for those
purposes. i.e., to do a sort/group/DISTINCT on a memo when it was
unfortunatel y required.

That is true (in Access 97 and older). However; in those versions
one could do all of those things against the first 255 characters
of a memo field by using Left([Field], 255).

In their infinite wisdom MS decided to modify all of the newer
versions so that instead of telling you that those things aren't
allowed with memo fields that just internally truncate all but the
first 255 characters automatically. That decision surely ranks in
the top ten as far as the newsgroup questions generated.
Does it? I've never seen anything about this automatic truncation,
but I guess I don't read all the posts.

Surely, newer versions of Access will respect, say, Left(MemoField,
4096), and not truncate?

Of course, any time you're sorting or grouping on memo fields,
you've probably got a design error, so I'm not sure this is a
terrible thing.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Oct 23 '06 #7
David W. Fenton wrote:
"Rick Brandt" <ri*********@ho tmail.comwrote in
news:zx******** ******@newssvr1 1.news.prodigy. com:
>That is true (in Access 97 and older). However; in those versions
one could do all of those things against the first 255 characters
of a memo field by using Left([Field], 255).

In their infinite wisdom MS decided to modify all of the newer
versions so that instead of telling you that those things aren't
allowed with memo fields that just internally truncate all but the
first 255 characters automatically. That decision surely ranks in
the top ten as far as the newsgroup questions generated.

Does it? I've never seen anything about this automatic truncation,
but I guess I don't read all the posts.
It comes up in the reports group all the time where people are only seeing
the first 255 characters of a memo field in their report output. Also where
formats were applied in forms or when exporting the data.
Surely, newer versions of Access will respect, say, Left(MemoField,
4096), and not truncate?
They would not truncate on that expression alone, but if you did one of the
"illegal" things with the output of that expression it would likely still
truncate it to 255.
Of course, any time you're sorting or grouping on memo fields,
you've probably got a design error, so I'm not sure this is a
terrible thing.
Exactly my point. When you did one of these things in older versions you
were given an error to clue you into the fact that you were likely going
astray. The newer versions just assume that allowing the operation while
truncating is "probably what the user really wants".

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Oct 24 '06 #8

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

Similar topics

3
10214
by: GorDon | last post by:
Hi, I have a report based on a query. The query grabs a memo field from my main table, yet when I display the memo field in the report it truncates the memo field (the field needs to hold more than 255 characters). The table holds all the memo text, but the query seems to truncate the memo field to 255 chars? This seems like there should be a relatively easy fix, but I can't seem to find it.
8
8215
by: skinnybloke | last post by:
Hi - I have a problem with a memo field being truncated to about 255 characters when running a Access 2002 query. This only seems to happen if I use SELECT DISTINCT. It works ok using SELECT by itself. does anyone know why this happens and how to stop it?
5
7386
by: Colin Anderson | last post by:
I discovered, with great excitement, this article http://www.davison.uk.net/vb2notes.asp when researching methods for emailing from Access via Notes. Unfortunatly, when I run this I get a Run-time error. When I run it on an XP machine it crashes, but on an NT box it just generates an unknown error, handled by the error handler. I have debugged and stepped through the code and have narrowed the issue to the point at which the...
6
2875
by: Sharper | last post by:
I have just downloaded lebans rtf2 which initially looks very interesting. Having a little trouble though in getting the RTF2 toolbar to appear on my own db although it is on the sample. I have imported the modules correctly (i think) and am able to create a RTF2 object from form design mode>active x , but cant find the toolbar. Secondly, is it possible to import text into an RTF2 memo field from say word or excel using GET EXTERNAL...
0
1647
by: Scott Van | last post by:
Hello- I am trying to create an Access table using DDL that has a memo field. I have the syntax to create the memo field but I can't find the syntax to also set whether the memo field should allow zero length. I can set this option using the Access interface directly, but I want to create this table and this column definition using a DDL script. Listed below is the script that works but I just need the syntax to set the additional...
2
3723
by: midlothian | last post by:
Hello Trying to update a memo field in an update query using the Replace function, and am getting a type conversion error. Here is my parameter: CStr(Replace(CStr(),"$",Chr$(13) & Chr$(10))) This fails. However, this also fails: CStr()
9
5740
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo field is printed within the detailed area. The problem is, the apllication is not setup properly, thus the users are entering data within the memo field as: location1 1/1/2005 1/1/2006
10
3059
by: ARC | last post by:
This is mainly a speed question. In this example: I have a QuotesHdr table that has a few memo fields. If these memo fields are used extensively by some users, and if their are a large number of records in QuotesHdr, should I break out the memo fields into a separate table? The thinking here is that, for Quotes selection dropdowns that display all entries in QuotesHdr for selection, I would think that the entire record comes down over...
2
3291
by: dhanashivam | last post by:
hi all, i am creating a VB6.0 application with Ms-Access database. While reading a memo field of my Ms-Access database, the recordset shows some invalid bad charecters like "(1of 2) Deemed automatically extended unless Tenant notifies Landlord at least 12 months prior their intention to vacate. Landlord must deliver by certified or registered mail an Automatic Renewal Notice at least fifteen (15) and not more than (30) days p ...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9979
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.