Add contents of one field to another (for a notes system)

R

RitchieJHicks

I am attempting to set up a notes system.

I have a memo field called "notes" (locked) and another memo field called
"notessubmit" in my table. I wish to have a button on my form which when
clicked, will add the text from the "notessubmit" field to the text already
in field "notes".

Can anyone advise me on this (N.B. my coding knowledge is minimal).

Thanks,
Ritchie.
 
S

smk23

Private sub cmdButton_onclick()
Dim strNotes as string

strNotes=Me.Notes

Me.Notes=strNotes & Me.Notessubmit

End Sub

This is very bare bones. I.e. nothing here to put in a space or new line
between the notes. Also, do you want the new note at the beginning or end of
the previous notes, etc.
Sam
 
R

RitchieJHicks

Hi Sam,

That's great. I think I understand. How would one set this so that it was at
the beginning of the exisiting note AND had a line-space inbetween the new
and existing?
 
J

John W. Vinson

I am attempting to set up a notes system.

I have a memo field called "notes" (locked) and another memo field called
"notessubmit" in my table. I wish to have a button on my form which when
clicked, will add the text from the "notessubmit" field to the text already
in field "notes".

Well...

That's really not an ideal design.

Storing multiple notes in a single memo field makes it harder to search, and
more complex.

Consider instead having a one to many relationship to a Notes table. This
could have fields for NoteBy (the userid of the person entering the note),
NoteDateTime defaulting to Now() to automatically timestamp the note, and a
memo field for the note. Rather than jamming all the notes together into one
field you could use a Subform (subreport for printing) displaying all of the
notes in chronological order... with NO button, no code, and much simpler
maintenance.
 
L

Linq Adams via AccessMonster.com

In point of fact, i.e. fields should only be used to hold memos, i.e. notes,
and should never be used to store data that will ever need to be searched,
sorted or manipulated in any way!

Used within these parameters, memo fields are great. But if there's any
chance you'll ever need to do any of these things, John's suggestion is a
much better approach.

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

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
J

John W. Vinson

In point of fact, i.e. fields should only be used to hold memos, i.e. notes,
and should never be used to store data that will ever need to be searched,
sorted or manipulated in any way!

Used within these parameters, memo fields are great. But if there's any
chance you'll ever need to do any of these things, John's suggestion is a
much better approach.

Well... Memo fields *can* be searched, with or without wildcards; they can
even be indexed in the latest version of Access. IMO it's not a good idea to
*depend* on being able to sort or search memos though, because at best it will
be inefficient.
 
R

RitchieJHicks

OK so I understand why using a field is not ideal. What I don't understand is
how to impliment your suggestion.

I have set up my field with Noteby, date (timestamped Now()) and the note
itself.

So now I need to set up a form and add it as a subform to my application.
How then, do i stop people from being able to alter their submitted notes?

Rgds,
Ritchie.
 
J

John W. Vinson

OK so I understand why using a field is not ideal. What I don't understand is
how to impliment your suggestion.

I have set up my field with Noteby, date (timestamped Now()) and the note
itself.

This is in a new *table*, right??
So now I need to set up a form and add it as a subform to my application.
How then, do i stop people from being able to alter their submitted notes?

Put a Subform on the form, bound to the notes table. Set that form's
properties to Allow Edits = No, Allow Additions = Yes.

It won't be an absolute, ironclad prevention of editing - anyone knowledgable
in Access can get around it - but the same applies to your memo field.
 

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