Problem keeping return keystroke on default value setting

G

Guest

I currently have a text box on a form that I have set to as a Memo to get
around the 255 max char problem. I am trying to get the text box to default
to a canned entry such as:

Name: XXXXX
Violation: XXX-XXXX
Social Security # XXX-XX-XXXX

I try to put that in the default value and I get:
Name: XXXXX Violation: XXX-XXXX Social Security # XXX-XX-XXXX

I've tried looking around to see if there was a function that automatically
printed out return values and the only two things I stumbled upon were chr()
and space().
The space function works, but I have to manually check how many spaces I
need to go to the next line, which is not hard but if you have to manually do
30+ entries that way, it can become quite the pain. The chr function is
something I remember doing in C++, in which I took the ascii code for a
return value of 13 or 10, I tried them both and put something like:

"Name: XXXXX" + chr(13)+ "Violation: XXX-XXXX"

but all I got was:

Name: XXXXXX|Violation: XXX-XXXX

That line wasn't exactly it, but it was a thick bar, almost like the text
box can't do the enter key and put the bar in instead. I enabled a value in
the box that enables the enter key behaviour to "New Line in Field" but no
luck. Any ideas on how to work around this issue would be greatly
appreciated. If you need any more information, I will supply any information
that you might need. I also understand I could create a new field for all
three of those entries, but they aren't the real entries, but examples.

Thanks in advance

Leroy
 
R

Rick B

One way to get a return in a memo field is to press CTRL+ENTER at the end of
the line.
 
R

Rick B

CHR(13) will not work by itself. try...


= "This is line 1." & chr(13) & chr(10) & "This is line 2."
 
G

Guest

Thank you for the quick response, but unfortunately that doesn't seem to have
fixed the issue. When I try the control + enter, I get:

Name: XXXXXX|Violation: XXX-XXXX

and when I try the & chr(13) & chr(10) &, I get this still:

Name: XXXXXX||Violation: XXX-XXXX

Those lines being the thick blue bars. Any other possible suggestions by
chance?

Thanks again

Leroy
 
R

Rick B

No. Pressing CTRL+ENTER inserts a carriage return on all the memo fields I
have tested. Open Northwinds and try it in the Employee Form on the second
tab. Does it work there?
 
G

Guest

Thanks a bunch! I figured out what I was doing wrong, which is weird, I still
don't understand why it wouldn't work the way I did it, but I tried doing the
control+enter again, but this time I didn't go to the ... button on the side,
I just did it in the one line bar and it worked. I attempted to do it again
under default value clicking on the ... on the side to see everything and get
it formatted the way I wanted, and it still gives blue bar. I'll just do it
without going to the ... spot for now, any ideas why that works that way?

Thanks again for all the help :)

Leroy
 

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