Line Return

M

Mark

Is it possible to enter a line return into any other field other than text (such
as number, currency or date/time)?

How can a user be prevented from entering a line return into a field?

Thanks!

Mark
 
M

Marshall Barton

Mark said:
Is it possible to enter a line return into any other field other than text (such
as number, currency or date/time)?


You could have just tried it.

Numeric and DateTime fields will not accept a new line.
 
M

Mark

Marsh,

I appreciate you responding to my post!

I did try it before posting and found what you said. However, it's important
enough that I wanted an independent confirmation. I assume you regard a currency
field as a numeric field.

Can you respond to the second question in my post ----
<<How can a user be prevented from entering a line return into a field?>>

Thanks!

Mark
 
K

KeejToe

If you position your cursor at the end of the field, and then hit <control-enter>, a line
feed wil be inserted, even in a date or numeric field. You can scroll between the lines
with the <up> or <down> keys. Try it.

To prevent, u can use an input mask or check the keycode in the KeyDown event.

Grtz,
K
 
M

Marshall Barton

Mark said:
I did try it before posting and found what you said.
However, it's important enough that I wanted an
independent confirmation.

I understand.
I assume you regard a currency
field as a numeric field.
Yes

Can you respond to the second question in my post ----
<<How can a user be prevented from entering a line return into a field?>>

Add a validation rule to the table's field:
Not Like "*" & Chr(13) & Chr(10) & "*"
 
M

Marshall Barton

KeejToe said:
If you position your cursor at the end of the field, and then hit <control-enter>, a line
feed wil be inserted, even in a date or numeric field. You can scroll between the lines
with the <up> or <down> keys. Try it.


When I try it in A97 and AXP, I can enter <ctrl+enter> on a
numeric or date field but I can not save the record with the
new line in any of those fields.
--
Marsh
MVP [MS Access]


 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top