Enter Key Behaviour in Textbox

  • Thread starter Thread starter Leonard Priestley
  • Start date Start date
L

Leonard Priestley

I have set the Enter Key property to 'New Line in Field' in a textbox
control called 'Description' (bound to a memo field).

If I complete an entry in a box above the 'Description' one, and press
Enter, the cursor moves to the 'Description' box, and then skips down one
line within the box.

That is, pressing the Enter key to get to this box is also putting an
unwanted 'Enter' into the box. If I set the Enter Key property to
'Default', I have no problem, but I'd like to know how to get the 'New Line
in Field' property to work properly.

Thanks

Leonard Priestley
 
The behavior that you describe isn't what I'd expect.

(1) Is there already an empty line in the Description textbox before you get
to it?

(2) By any chance are you hitting the Enter key twice?

(3) Is there any code running on the Description textbox (OnEnter,
OnGotFocus events)?
 
Ken,
Thank you for your prompt reply.

The answers to your questions:

(1) No, there is no empty line pre-existing. There is no default value,
either in the underlying table, or in the textbox Default property. I have
experimented with placing the mouse cursor in the Description box and
pressing the Backspace key, and the Delete key, to get rid of any existing
space, and it makes no difference to the problem.

(2) No, I have tried being very careful, and I am sure I'm not entering two
keystrokes.

(3) No, there is definitely no code attached to the control.

In my original message, I said that I was using a memo field. I now realize
that that is not the case. The textbox is bound to a 200 character text
field. The textbox has the vertical scroll enabled, but I have also tried
it without the scroll bar.
I have recently copied all the relevant contents of the original database to
a new one, as a clean-up process, and I have compiled and saved all modules,
so I doubt if there is any rubbish to give me problems. The references I am
using are:
Visual Basic for Applications
MS Access 8.0 Object Library
MS DAO 3.51 Object Library

By the way, I forgot to say that I am using Access 97

Leonard Priestley
 
Weird...

If you would like, zip up a sample of the database and email to me (remove
this is not real from my address). I'll take a look as soon as I have a few
minutes.
 
Back
Top