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

Help handling string length overflow?

I have a form where the user copies a handwritten contract into a text
field "Contract1".
The contract usually exeeds 255 characters.
Therefore I provided "Contract2", "Contract3", and "Contract4" fields.
When "Contract1" cannot accept further input, the user continues on to
"Contract2", ect.

I don't want to use memo fields for obvious reasons.

Does anyone have an event procedure and code, which could monitor
typing and programatically move text from the last cariage return to
"Contract2".

Any help sincerely appreciated

Dec 1 '05 #1
11 4120
wo********@comcast.net wrote:
I have a form where the user copies a handwritten contract into a text
field "Contract1".
The contract usually exeeds 255 characters.
Therefore I provided "Contract2", "Contract3", and "Contract4" fields.
When "Contract1" cannot accept further input, the user continues on to
"Contract2", ect.

I don't want to use memo fields for obvious reasons.

Does anyone have an event procedure and code, which could monitor
typing and programatically move text from the last cariage return to
"Contract2".

Any help sincerely appreciated

Well, have you considered making the field a memo field?

This sounds so inefficient tho. Why not scan the contract in to a file
and provide a link to it.
Dec 1 '05 #2
Handwritten contracts.
I don't want to use memo fields for obvious reasons as you point out.

Dec 1 '05 #3
wo********@comcast.net wrote:
Handwritten contracts.
I don't want to use memo fields for obvious reasons as you point out.

Oh. I overlooked your statement you don't want to use a memo field.

You could see what the largest contract is. Then create a whole slew of
fields to hold the longest contract. Create an input mask with 255
characters and when the person hits the limit trap the form's OnError
event and go to the next field.

If I had any inclination to do what you are attempting (and I never
would) I would make a separate table with a link to the key and a
contract text field. Now I'd make the contract field(s) a subform with
Cycle set to AllRecords. It would be considered a kludge of major
proportions. Editting the contract would be a major pain in the ass.
It wouldn't automatically reformat if you deleted words or phrases, but
by God it would not use memos and you'd go to the next record if you got
to the end of the field.


Dec 1 '05 #4
I've been using memo fields in Access and X-Base systems now for twenty
years or so and I have missed the obvious reasons for not using them.
What are they?

Dec 1 '05 #5
salad wrote:
Now I'd make the contract field(s) a subform with
Cycle set to AllRecords. It would be considered a kludge of major
proportions.


As an aside related to this, Banner Finance, an oracle package does
something like this with the stupidest effects. When you want to add
comments to a particular item, you must go to something called document
text which only allows you 50 characters in a field. So if you want to
add a large amount of clarification or whatever, you end up adding
multiple records against the item, each of which is only allowed to hold
up to 50 characters.

I was told by a developer who supports Banner at our organization that
the reason for this was that when the package was originally put
together, fixed space fonts only permitted 50 characters on the
invoice/requisition/purchase order/whatever the heck in the space on the
paper when it was printed.

It's one of the dumbest things I've ever seen, yet, Banner is a very
successful (in terms of sales and implementation) financial package.

It is a nightmare of a GUI anyway, that a 12 year old with a Tandy could
have bettered 20 or more years ago...
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Dec 1 '05 #6
I think that maybe I was abiguous in my description.

"Contract1" through "Contract4" are really 1 field on one record and
are already on a subform.
I dont know how cycling through all records would do anything.
"Contract1" should have been named ""Contract Description" here for
clarity.
"Contract2" should have been named ""Contract Description
continuation2" here for clarity.
Etc through "Contract4".
I need code to monitor string length during data entry.
When a sentence reaches the 255 string limit, it would then cut this
last sentence and append it to "Contract2", etc

Dec 1 '05 #7
wo********@comcast.net wrote:
I think that maybe I was abiguous in my description.

"Contract1" through "Contract4" are really 1 field on one record and
are already on a subform.
I dont know how cycling through all records would do anything.
"Contract1" should have been named ""Contract Description" here for
clarity.
"Contract2" should have been named ""Contract Description
continuation2" here for clarity.
Etc through "Contract4".
I need code to monitor string length during data entry.
When a sentence reaches the 255 string limit, it would then cut this
last sentence and append it to "Contract2", etc


Me, I'd write a function. I'd store all of the data into the 4
components and then restore to a single entry. I could then grab the
first 255 characters. Since you are interested in sentences, I'd scan
backwards on the first 255 chars and find a period. That'd be desc1.
Then from that positition add the remaining chars to a string. if the
string is over 255 in len, get the next 255 chars and count backwards to
the next period. Continue to complete it. Piece of cake.

I could even then extract the fields from a memo into a query. Call the
function within the query with the parameter 1-4 to determine which line
to return.
Dec 1 '05 #8
I think I can do either of 2 things:

1. Add a memo field to the table.
Then have them type into the memo field.
Then on lost focus, run code to add sentences from the memo field,
until the string variable exeeds 255 length.
Then look back for the period.
Then record the string position X of the period in variable.
Then Record the next string position Y that is not a space.
Then cut the first X number of characters.
Then paste these first X characters into "Contract1"
Then analyze the remainding memo field the same way.
Then paste these first X characters into "Contract"
Etc.

2. Add an unbound field to the form and do the above.

I just don't know if # 2 above would limit me to 255 characters

Question?

If I use the memo field as a type into buffer and then delete its
content, will I avoid the slowdown I would otherwise have by
not using Unicode?

Will the database allocate space for empty memo fields?

Will it require compacting more often?

What do you think

Dec 2 '05 #9
wo********@comcast.net wrote:
I think I can do either of 2 things:

1. Add a memo field to the table.
Then have them type into the memo field.
Then on lost focus, run code to add sentences from the memo field,
until the string variable exeeds 255 length.
Then look back for the period.
Then record the string position X of the period in variable.
Then Record the next string position Y that is not a space.
Then cut the first X number of characters.
Then paste these first X characters into "Contract1"
Then analyze the remainding memo field the same way.
Then paste these first X characters into "Contract"
Etc.

2. Add an unbound field to the form and do the above.

I just don't know if # 2 above would limit me to 255 characters

Question?

If I use the memo field as a type into buffer and then delete its
content, will I avoid the slowdown I would otherwise have by
not using Unicode?
In a form, there is no "memo" field if unbound. Basically, all form
objects are variants. If you add a control source that is date, the
type is date, if numeric it is the numeric type, of string, it's string.
But basically, all controls are variants for input if unbound. So I
would not concern myselft with type. If you need 4 fields, concatenate
all 4 fields, input on the string/variant field, and then parse out.
Much cleaner.
Will the database allocate space for empty memo fields?
If unbound, there is no concern.
Will it require compacting more often?
I can't see why. Bloat is bloat. It exists. It gets created. Compact
it. It may or may not occur in this form.
What do you think


To write the function to parse out the data is not complex, nor a
function to extract and return the string value if stored in a field is
not complex.
Dec 2 '05 #10
No, it's not obvious.

I don't want our sales manager coming in and wacking a couple
of memo fields on every record (they like that), but I can use
a memo field where required.
(david)

<wo********@comcast.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have a form where the user copies a handwritten contract into a text
field "Contract1".
The contract usually exeeds 255 characters.
Therefore I provided "Contract2", "Contract3", and "Contract4" fields.
When "Contract1" cannot accept further input, the user continues on to
"Contract2", ect.

I don't want to use memo fields for obvious reasons.

Does anyone have an event procedure and code, which could monitor
typing and programatically move text from the last cariage return to
"Contract2".

Any help sincerely appreciated

Dec 2 '05 #11
"Lyle Fairfield" <ly***********@aim.com> wrote
I've been using memo fields in Access and X-Base systems now for twenty
years or so and I have missed the obvious reasons for not using them.
What are they?


Lyle's question is obvious to me; the reasons for not using memo are not. I,
too, would appreciate knowing.

Aside from some product defects, on rare occasions, that have affected memo
fields, they work "as advertised" and I have had no problems attributable to
using them.

Larry Linson
Microsoft Access MVP
Dec 2 '05 #12

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

Similar topics

0
by: Viktor Lundström | last post by:
Hi! I recently decided to write a streambuf which handles streamed IO to a device (ie. a socket). Now, in an effort to move away from C-style IO error handling (ie. if(read(..) == -1) ...), I...
4
by: Roberto Dias | last post by:
Hi all, I've got some column delimited text files used as input file to a power engineering application. I'm trying to create a "more-friendly" interface using C++. The C++ program should be...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
9
by: C# Learner | last post by:
Some time ago, I remember reading a discussion about the strengths and weaknesses of exception handling. One of the weaknesses that was put forward was that exception handling is inefficient (in...
1
by: Bob | last post by:
Hi, Hope you can help me with this one. I'm at my wits end. I'm trying to create an intelligent edit-box like the excellent "Customer" one at the URL: ...
2
by: davidson1 | last post by:
Hai friends..for menu to use in my website..i found in one website....pl look below website.... http://www.dynamicdrive.com/dynamicindex1/omnislide/index.htm i downloaded 2 files.... ...
4
by: DHS1 | last post by:
Hey guys. I have a lab that is due in two weeks, but I wanted to start on it now. Problem is, I'm at home during christmas break so I can't ask my professors. Here's my problem: I am given a very...
2
by: hcaptech | last post by:
This is my Test.can you help me ? 1.Which of the following statement about C# varialble is incorrect ? A.A variable is a computer memory location identified by a unique name B.A variable's name...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
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
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
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
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,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.