Next line in memo (text) field

  • Thread starter Thread starter Erwin Bormans
  • Start date Start date
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
 
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
 
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
 
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
 
I tried with the vbCrLf and it works just perfect!

Thx a lot

Kind regards
Erwin
 
Back
Top