Adding Comments

  • Thread starter Thread starter me
  • Start date Start date
M

me

In order to prevent users from editing saved comments, I
have an Add Comments text box that appends data to the
Comments field using:
Me!txtComments = Me!txtComments & "," & Me!NewComments
The only problem is I don't want the "," added if it's the
first Comment entered. Switching the placement to after
NewComments doesn't help either if it's the only Comment.
How can I add the comma only if it's an addition to
existing data? Thanks for the help.
 
A better (and normalized) solution would be to have a table for comments in
which each comment is a separate record that has the primary key of the
record you are commenting on, stored along with the date and username of the
person making the comment. In the long run this will provide you with much
more functionality and stability. Then to restrict editing of existing
comments just change the AllowEdits property of the form to false while
leaving the AllowAdditions property true.
 
Thanks Sandra. I guess the thing I struggle with when it
comes to normalizing at this level is that when it comes
to retrieving data and presenting in a useable format all
these "child" records need to be merged back together and
I start to see performance issues. If you have some
additional information on the best practices to handle
this combining of data I would really welcome it.
-----Original Message-----
A better (and normalized) solution would be to have a table for comments in
which each comment is a separate record that has the primary key of the
record you are commenting on, stored along with the date and username of the
person making the comment. In the long run this will provide you with much
more functionality and stability. Then to restrict editing of existing
comments just change the AllowEdits property of the form to false while
leaving the AllowAdditions property true.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

In order to prevent users from editing saved comments, I
have an Add Comments text box that appends data to the
Comments field using:
Me!txtComments = Me!txtComments & "," & Me!NewComments
The only problem is I don't want the "," added if it's the
first Comment entered. Switching the placement to after
NewComments doesn't help either if it's the only Comment.
How can I add the comma only if it's an addition to
existing data? Thanks for the help.


.
 
Thanks. A little typo on Me!txtNewComments that had me for
a bit but it's what I need for now (until/if I decide to
normalize like Sandra suggests.
 
That really shouldn't be an issue - related data of this nature is best
displayed in a subform or subreport. Access will handle most of the linkage
for you (provided that you've defined relationships between the tables).
There are times when a "list aggregate" would be nice and you're right that
there is a performance hit when you try to do it in code. In reality though,
most of the time there are far greater benefits from storing the data
correctly.

Do you really need to have the comments merged into a narrative or could
they be just as useful if reported as separate records?

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

Thanks Sandra. I guess the thing I struggle with when it
comes to normalizing at this level is that when it comes
to retrieving data and presenting in a useable format all
these "child" records need to be merged back together and
I start to see performance issues. If you have some
additional information on the best practices to handle
this combining of data I would really welcome it.
-----Original Message-----
A better (and normalized) solution would be to have a table for
comments in which each comment is a separate record that has the
primary key of the record you are commenting on, stored along with
the date and username of the person making the comment. In the long
run this will provide you with much more functionality and
stability. Then to restrict editing of existing comments just change
the AllowEdits property of the form to false while leaving the
AllowAdditions property true.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

In order to prevent users from editing saved comments, I
have an Add Comments text box that appends data to the
Comments field using:
Me!txtComments = Me!txtComments & "," & Me!NewComments
The only problem is I don't want the "," added if it's the
first Comment entered. Switching the placement to after
NewComments doesn't help either if it's the only Comment.
How can I add the comma only if it's an addition to
existing data? Thanks for the help.


.
 
Apologies for the typo.

Glad to have been of some service although I agree that Sandra's advice
regarding Normalisation is the best way to go forward on this.

Andy W
 
Back
Top