Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editing a Memo field using a TextBox 1

Status
Not open for further replies.

Rajesh Karunakaran

Programmer
Sep 29, 2016
549
MU
Dear Team!

Is it possible to edit a Memo field using a text box. I have a field for email id which is Memo. I want to give access to this field on a form using a TextBox keeping the field as its control source. But, I am getting 'memo' written in the text box and I am not able to edit it.

Any Idea?

Thanks,
Rajesh
 
Use an edit box instead. If you want it to look like a textbox, size it appropriately and turn off the scrollbars.
 
I agree with Dan. A text box is intended for relatively short pieces of text, such as names, addresses, amounts, dates, etc. An edit box is intended for text of any length - just like a memo field.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Rajesh,
One other thing to consider, is an OLERTF control, if you want to be able to edit text as rich text (color, font, font properties like bold, italic, etc. You may not need all that this time, but it does make for much nicer looking applications. I've started replacing edit boxes with these.


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Memo is unusual for a mail address. The core address has a length limit anyway, the only part of a mail address, which could be longer is the part in <>, eg as in "olafd@somewhere.com [highlight #FCE94F]<Olaf Doschke>[/highlight]"

Because of that the Address could be longer than the longest CHAR(254) field you can define in a DBF, but if that's not even part of your email values, the simplest is to change the field type.

You can only bind a column in a brows or grid to a memo and a double click then pops up a memo edit window. The textbox itself will only display "memo" for empty fields and "Memo" with capital M for memo fields with value. That's how memos show up in a Browse by default and that's why it doesn't work in a single textbox, the double click is not popping up an edit window, if I try that mself.

So when you stay with Memo, as your tables are defined that way and you can't change it, then you need to use an editbox, as others already said.

Bye, Olaf.



Olaf Doschke Software Engineering
 
I always use memo for email addresses and URLs and anything else like that. I don't want to worry about how long they might be.

For email, it appears 254 max. I'd rather use a memo than a 254-char field.

Tamar
 
Agree with Tamar on that 100%.
I also use memo's to hold directory and file names stored locally.


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Do you know anyone with such a long mail address? I agree a long char field most often is a waste, and as wrong as the 254 instead of 256 char limit is - a memo is more practical even sooner - but either I have a server backend with real varchar fields or it's not that many records I'd worry much about it. Also, autocomplete is nice, especially if you split mail address entry into the two parts.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Thank you dear Dan for your suggestion.

Thanks to Mike, Scott, Olaf & Tamar for your time and inputs.

I think I would go for an edit box as changing the filed type may not be a possible option.
Too, as Tamar said I need not worry about the length even while I completely agree with Olaf that its very very rare that someone has an email id of around 200 characters!

Thank you all,
Rajesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top