By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,827 Members | 2,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,827 IT Pros & Developers. It's quick & easy.

Memo Fields in Access 2003

P: 2
Hi, would really like your help - I'm having a problem with a memo field. I want to format a memo field so that I can put in a carriage return to move to a new line. Is there a way to easily add new text to this memo field when I reopen the form.

Thanks for your help

Alan
Feb 1 '08 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 446
Hi Alan
I'm a little surprised that your Memo field has not had this set automatically (although it may depend on how you build your form)

If you select the control in Design mode, open Properties then go to the 'Other' tab and you will find 'Entry Key Behaviour'. Set it to 'New Line in Field'

I hope this is what you mean

S7

PS. I would check it has a vertical scroll bar too!

You also know that you can use Shift +F2 to 'zoom' any field but I find particiularly useful when I am forced to use Memo fields.
Feb 1 '08 #2

missinglinq
Expert 2.5K+
P: 3,532
An Acccess form doesn't know a memo field from Adam! A textbox is a textbox is a textbox, regardless of the data type it holds. The default for Entry Key Behavior is Default, which is to say, whatever behavior is set under Tools - Options - Keyboard. Those choices are Don't Move, Next Field or Next Record. Move to new line can only be set as you've indicated, and the scrollbar(s) default to None, so this will have to be set if desired. If memory serves, they only appear when the textbox has focus.

If by "Is there a way to easily add new text to this memo field when I reopen the form" you mean can you automatically move to the end of the data already in the memo field, use this code, replacing YourMemoField with the actual name of your textbox.

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourMemoField_GotFocus()
  2.  
  3. If Len(YourMemoField) > 32767 Then 
  4.   YourMemoField.SelStart =  32767
  5. Else
  6.   YourMemoField.SelStart =  Len(YourMemoField)
  7. End If
  8.  
  9. End Sub
Welcome to TheScripts, alany!

Linq ;0)>
Feb 1 '08 #3

Expert 100+
P: 446
An Acccess form doesn't know a memo field from Adam! A textbox is a textbox is a textbox, regardless of the data type it holds.Linq ;0)>
Hi Linq
You've obviously stopped using the Wizard or the Field List icon when building new forms. The layout invariably needs changing but they save a lot of the more menial work.

Interesting code though to overcome the default settings of Behaviour Entering Field.

S7
Feb 4 '08 #4

P: 1
Hi!
This MS Access code was very helpful but I ran into one problem. If you apply the code in the 'On Got Focus' option in properties the code will fail when the memo field has not data entered. Now, I am very new to VBA coding but I was able to change the code to look as follows to eliminate the error when the memo field is blank. My form has 5 memo fields.

Private Sub YourMemoField_GotFocus()

If Len(YourMemoField) > 0 Then
YourMemoField.SelStart = 32767
Else
YourMemoField.SelStart = 0

End If

End Sub


Any way this code was very helpful in solving a data entry issue for my business customer. Thanks!
Oct 24 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.