New Line in the default value of a text box in form

S

sarahdavis

I need to input a default value for a text box in a form but is there any way
that I can put the default value so that certain things appear on seperate
lines within the text box - as follows...

Lives with
Daily visits x

At current I get all on one line in the text box:
Lives with Daily Visits x

How would I alter the default value from
"Lives with Daily Visits x" to get it to appear as above?

Sarah Davis.
 
A

Allen Browne

Include a carriage return and line feed in the Default Value property, e.g.:
"Lives with " & Chr(13) & Chr(10) & "Daily Visits"

(Sarah, I'm not really convinced that poking lots of info into a memo is the
best solution here, particularly if you may want to query things like the
daily visits.)
 
J

John W. Vinson

I need to input a default value for a text box in a form but is there any way
that I can put the default value so that certain things appear on seperate
lines within the text box - as follows...

Lives with
Daily visits x

At current I get all on one line in the text box:
Lives with Daily Visits x

How would I alter the default value from
"Lives with Daily Visits x" to get it to appear as above?

Sarah Davis.

Ummm....

You're misusing Access.

It really looks like you're trying to store distinct, legitimate, atomic
"chunks" of information - "Lives With" and "Daily Visits" - as separate lines
in a single field. This is a mistake. It will be all but impossible to search
this data; it will be utterly impossible to sort it (say by the value of Daily
Visits).

If you have these discrete chunks of information, why not store each of them
in a different field?

John W. Vinson [MVP]
 
S

sarahdavis via AccessMonster.com

If I only had the control or authority to be putting it in seperate fields I
absolutely would have by now. I have designed Access databases for years but
I am now constrained by the British institution known as the NHS and cannot
do what I want. We don't wish to search these fields anyway. It is totally
illogical I know!

Sarah.
I need to input a default value for a text box in a form but is there any way
that I can put the default value so that certain things appear on seperate
[quoted text clipped - 10 lines]
Sarah Davis.

Ummm....

You're misusing Access.

It really looks like you're trying to store distinct, legitimate, atomic
"chunks" of information - "Lives With" and "Daily Visits" - as separate lines
in a single field. This is a mistake. It will be all but impossible to search
this data; it will be utterly impossible to sort it (say by the value of Daily
Visits).

If you have these discrete chunks of information, why not store each of them
in a different field?

John W. Vinson [MVP]
 
S

sarahdavis via AccessMonster.com

Could you clarify the Chr(13) thing? Exactly what do I have to type into the
Default Value box. I am not sure how the Chr criteria is differentiated from
the text I need to see.

Sarah.

Allen said:
Include a carriage return and line feed in the Default Value property, e.g.:
"Lives with " & Chr(13) & Chr(10) & "Daily Visits"

(Sarah, I'm not really convinced that poking lots of info into a memo is the
best solution here, particularly if you may want to query things like the
daily visits.)
I need to input a default value for a text box in a form but is there any
way
[quoted text clipped - 11 lines]
Sarah Davis.
 
A

Allen Browne

Exactly as shown.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

sarahdavis via AccessMonster.com said:
Could you clarify the Chr(13) thing? Exactly what do I have to type into
the
Default Value box. I am not sure how the Chr criteria is differentiated
from
the text I need to see.

Sarah.

Allen said:
Include a carriage return and line feed in the Default Value property,
e.g.:
"Lives with " & Chr(13) & Chr(10) & "Daily Visits"

(Sarah, I'm not really convinced that poking lots of info into a memo is
the
best solution here, particularly if you may want to query things like the
daily visits.)
I need to input a default value for a text box in a form but is there any
way
[quoted text clipped - 11 lines]
Sarah Davis.
 
S

sarahdavis via AccessMonster.com

Thanks - one last thing, could you clarify the significance of the number in
brackets (the line feed number) and how would I change this to add additional
lines?

Sarah.

Allen said:
Exactly as shown.
Could you clarify the Chr(13) thing? Exactly what do I have to type into
the
[quoted text clipped - 18 lines]
 
A

Allen Browne

Chr() generates a character matching the number in brackets, e.g. Chr(65)
gives upper case A.

Chr(13) is the carriage return character.
Chr(10) is the line feed character.

Use Chr(13) & Chr(10) as many times as you need a CR/LF.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

sarahdavis via AccessMonster.com said:
Thanks - one last thing, could you clarify the significance of the number
in
brackets (the line feed number) and how would I change this to add
additional
lines?

Sarah.

Allen said:
Exactly as shown.
Could you clarify the Chr(13) thing? Exactly what do I have to type into
the
[quoted text clipped - 18 lines]
Sarah Davis.
 
S

sarahdavis via AccessMonster.com

Thank you so much!

Sarah.

Allen said:
Chr() generates a character matching the number in brackets, e.g. Chr(65)
gives upper case A.

Chr(13) is the carriage return character.
Chr(10) is the line feed character.

Use Chr(13) & Chr(10) as many times as you need a CR/LF.
Thanks - one last thing, could you clarify the significance of the number
in
[quoted text clipped - 11 lines]
 
J

John W. Vinson

I am now constrained by the British institution known as the NHS and cannot
do what I want.

Alas... then there is no hope of rationality or good sense, you're dealing
with government bureaucrats! <wry grin>

Good luck, and I hope Allen's help is working for you.

John W. Vinson [MVP]
 

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