Next line in memo (text) field

E

Erwin Bormans

Hi

I've got a memo field remarks. But everytime a user enters a remark the
current date should be entered aswell. I use the following code:

Me.txt_Opmerking.Value = Date & Chr(10) & Me.txt_OpmToevoegen.Value &
Chr(10) & Chr(10) & Me.txt_Opmerking.Value

But he still displays everything on 1 line.

What I'm doing wrong?

Kind regards
Erwin
 
J

Jeff Boyce

Erwin

You might also need the Chr(13) (carriage return and line feed).

By the way, your memo field will, in the long run, prove quite difficult to
search, especially by date or remarker or comment. Another approach would
be to create a Comments table, add a Date/Time field, a [Remarker] field and
a [Comment] field (text), and put one record for each comment.

Good luck

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
E

Erwin Bormans

I tried to put the chr(13) with it.
But he still displays everything on 1 line.

I don't need to search on my memo field. This belongs to an article where I
can search for and that I need all the remarks.

Thx for the hint

Kind regards
Erwin


Jeff Boyce said:
Erwin

You might also need the Chr(13) (carriage return and line feed).

By the way, your memo field will, in the long run, prove quite difficult
to search, especially by date or remarker or comment. Another approach
would be to create a Comments table, add a Date/Time field, a [Remarker]
field and a [Comment] field (text), and put one record for each comment.

Good luck

Regards

Jeff Boyce
Microsoft Office/Access MVP

Erwin Bormans said:
Hi

I've got a memo field remarks. But everytime a user enters a remark the
current date should be entered aswell. I use the following code:

Me.txt_Opmerking.Value = Date & Chr(10) & Me.txt_OpmToevoegen.Value &
Chr(10) & Chr(10) & Me.txt_Opmerking.Value

But he still displays everything on 1 line.

What I'm doing wrong?

Kind regards
Erwin
 
S

Steve Schapel

Erwin,

I'm pretty sure the Chr(13) must come before the Chr(10). So, the
syntax would be like this...

Me.txt_Opmerking.Value = Date & Chr(13) & Chr(10) &
Me.txt_OpmToevoegen.Value & Chr(13) & Chr(10) & Chr(13) & Chr(10) &
Me.txt_Opmerking.Value

Alternatively, since this appears to be within a VBA procedure, you can
use vbCrLf, like this (dropping the .Value property specification)...

Me.txt_Opmerking = Date & vbCrLf & Me.txt_OpmToevoegen & vbCrLf &
vbCrLf & Me.txt_Opmerking
 
E

Erwin Bormans

I tried with the vbCrLf and it works just perfect!

Thx a lot

Kind regards
Erwin
 

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