Help with code

  • Thread starter Thread starter RitchieJHicks
  • Start date Start date
R

RitchieJHicks

Hi,

I have this code which was suggested to add the test from 1 field to another.

What I need to know is how to make the text attach to the BEGINNING of the
field it is going in to, not the end as it currently does. Also, how can I
place a space between the previous and the new text (as such a new paragraph
in the memo field). Here is my code:

Private Sub DoNotesCommand_Click()
Dim strNotes As String

strNotes = Me.Notes

Me.Notes = strNotes & Me.Notessubmit

End Sub

Hope you can help.
Ritchie.
 
This should do what you want:

Private Sub DoNotesCommand_Click()
Dim strNotes As String

strNotes = Me.Notes.value

Me.Notes.value = Me.Notessubmit.value & " " & strNotes

End Sub
 
Hi Chris,

That's great as it places the text at the beginning, but it does not start a
new line underneath.

What I get now in the field when I submit is (for example):

This is a testThis is a testThis is a test

whereas I actually need

This is a test

This is a test

This is a test

I presume I need to add something to the quotation marks at
Me.Notessubmit.value & " " & strNotes?

Regards,
Ritchie
 
Unfortunatly that gives me a compile syntax error.

Do you have any other thoughts on this? It worked fine until that new peice
of code.

Thanks very much for your help.
Ritchie.
 
Make sure that the Enter Key Behavior property for the control is set to "new
line in field". Try the code again. If it still doesn't work then use

Me.Notessubmit.value & vbCrlf & strNotes
 
If you actually used

Me.Notessubmit.value & Chr(13) & Chr(10) & strNotes


you will pop an error. It needs to be

Me.Notes.Value = Me.Notessubmit.value & Chr(13) & Chr(10) & strNotes

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
Hi,

Well that starts each entry on a new line, but there's still no line
seperating each entry!! Are you getting fed up with me yet????!!!

Regards,
Ritchie.
 
Which ever code worked just repeat it to insert a blank line. Your code would
be either

Me.Notes.Value = Me.Notessubmit.value & Chr(13) & Chr(10) & Chr(13) &
Chr(10) & strNotes

or

Me.Notes.Value = Me.Notessubmit.value & vbCrlf & vbCrlf & strNotes

HTH,
Chris
 
Back
Top