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

Detecting MEMO field

Hi all,

i'd like to know if there is some way to detect whether a field is of type
MEMO (i'm using MS Access) so to behave accordingly placing a textarea
instead of a textbox in the UI.

Thank You,
Lorenzo
Jul 19 '05 #1
3 1787
Assuming your Recorset is calle RS and you want to detect the first field
use this :

FS = RS.Fields(0).DefinedSize

For a normal string value you will get a max of 255, where you have a larger
value for a memo field (536870910)

So after that you do this :

If FS < 256 THEN
'Code for textbox"
ELSE IF FS > 500000000 THEN
'code for textarea
END IF

Meindert, MCP

"Lorenzo Bolognini" <lo*****@mysurname.net> wrote in message
news:oq*********************@news1.tin.it...
Hi all,

i'd like to know if there is some way to detect whether a field is of type
MEMO (i'm using MS Access) so to behave accordingly placing a textarea
instead of a textbox in the UI.

Thank You,
Lorenzo

Jul 19 '05 #2
Lorenzo Bolognini wrote:
Hi all,

i'd like to know if there is some way to detect whether a field is of
type MEMO (i'm using MS Access) so to behave accordingly placing a
textarea instead of a textbox in the UI.

Thank You,
Lorenzo


The best way is to check the Field's Type property. If you go here:
http://www.able-consulting.com/ADODataTypeEnum.htm, you will see the data
mappings between the ADO datatype constants and the corresponding native
datatypes for a few databases (including Access). So, if the Field's Type
property contains 201 (adLongVarChar) or 203 (adLongVarWChar), then it's a
Memo field.

Bob Barrows
Jul 19 '05 #3
Thanks very much to both!

Lorenzo
Jul 19 '05 #4

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

Similar topics

6
by: Shyguy | last post by:
I want to create two buttons on a form. One would allow the user to Copy the contents of the current records memo field, the other would allow them to print. I set up a report based on the memo...
3
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...
2
by: Bob Dydd | last post by:
Hi Everybody I have a Listbox that has a Memo field attached to it's 2nd column which on double click copies the memo field to another Memo Field. Forms!! = ListClassification.Column(1) My...
2
by: Kevin | last post by:
Thanks for the very quick response posting that I can use a memo datatype to store large amounts of text. I understand that I can turn on "Can Grow" for a memo type, but is there either a...
4
by: Mark Reed | last post by:
Hi All, here is what I am trying to achieve. I have a memo field on a form which users will need to add to as and when. I do not want them to be able to edit information which already exists...
1
by: alexsg | last post by:
A little while ago Ron P kindly responded to my inquiry on how to copy the first line of memo field into a text field, using a query: left(,instr(1,,vbCrLf)-1) This is great, but I would like...
9
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...
2
by: Roger | last post by:
I've got two tables in sql2005 which have an 'ntext' field when I linked the first table in access97 last week using an odbc data source the access-field type was 'memo' when I link the 2nd...
10
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
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...

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.