Select the text field where you want the behaviour changed, open the properties dialog and select the Other tab.
Change the property for Enter Key Behaviour to New Line in Field.
This won't automatically place a carriage return at the end of the field but will allow users to use enter to start a new line.
Larry De Laruelle
ldelaruelle@familychildrenscenter.org
Did you try putting some code in the LostFocus event for the field? Something like:
MyTextBox = MyTextBox & Chr(WhatEverTheCharCodeForAReturnIs) Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
Larry,
Thanks for your reply, but your suggestion might not help because, once I user finishes typing in a text field, he/she will not likely hit the return.....hmmmmm
what now?
THoey,
I will give your suggestion a shot, if I can find the character code for this. Thanks to both of you for responding.
Do you want the cursor to automatically go to the next field?
If so, that is a slightly different color of horse. In that case, set the AutoTab property to true. Only problem is that this only works well with formatted fields. With text fields, it only works when the user hits the character limit for the field.
Sounds like you may need to do some user education which is always an ongoing enterprise. Larry De Laruelle
ldelaruelle@familychildrenscenter.org
Larry,
Yes, I would like for the cursor to automatically go to the next line, once the user exits the field, and the field is set to "Memo" to allow for unlimited characters.
In that case, the only way is for the user to hit either the tab key or enter key if its property is left at default. Larry De Laruelle
ldelaruelle@familychildrenscenter.org
Actually I was wrong, saying that this was a text field. It's actually a memo field on a form. For the properties "On Lost Focus" I wrote the following code:
nameoffield = nameoffield & Chr$(13)
That piece of code worked, but everytime that the function is met (On Lost Focus), it adds another return. What kind of If Then statement could I write if I have already told it to put in an return at the end of all the text, but if there is one there already, I would tell it not to put another?
If nameoffield = nameoffield & Chr$(13) Then
Do Nothing
Now I know the "Do Nothing" part is not correct, at least I think it's not. Is there code for the "Do Nothing" part or is that correct?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.