Date Stamping & Protecting a Comment Field

G

Guest

Hello

I am a little confused on how to do this but....

I have a form field which contains customer information. Also included in
this form is a comments memo field, where the user can write free form
comments/ memos relating to the customer.

I want to do two things:-

1. Have the date automatically appear in the comments box BEFORE the user
starts typing comments

2. I want to protect this field so that comments cannot be deleted or
amended once typed.

Looking at what I want to do, it may appear that I must have a separate form
titled comments that is somehow linked to the main form. I assume that there
would need to be a command button on the main form page that opens the
comments form. Once clicked, it would open up the comments form,
automatically show the days date and allow the user to type in his comments .
Once these comments are saved (by pressing a save & close button in the
comments form) then this data should not be able to be deleted or amended in
any way.

Hope I am not being too confusing??!!

Thanks!
 
A

Allen Browne

Create a 2nd table, related to the first, so that one customer can have many
comments over time.

This table will have 3 fields:
CustomerID relates to the primary key field of your customsers table.
NoteDate Date/Time field, with Default Value of =Date()
Note Memo field where the user enters the comment.

You can then put a subform on your main form to show the comments for that
customers. On this subform, set AllowAdditions to Yes, AllowDeletions to No,
and AllowEdits to No.
 
G

Guest

Hello Allen

The Subtable ETC appear just fine thanks, however I Get the following error
message when I try and enter more than one comment for the customer:-

"The Changes you requested to the table were not successful because they
would create duplicate values in the index, primary key or relationship.
Change the data in the field or fields that contain the duplicate data,
remove the index or redfine the index to allow duplicates and try again"

Dont know what I did wrong???
 
A

Allen Browne

In the comments table, CustomerID cannot be the primary key.

Add another field (AutoNumber) to be the primary key, so that the CustomerID
field can appear many times in this table (i.e. there can be multiple
comments for a customer.)
 
G

Guest

Thanks Allen

You sure know your stuff!

Allen Browne said:
In the comments table, CustomerID cannot be the primary key.

Add another field (AutoNumber) to be the primary key, so that the CustomerID
field can appear many times in this table (i.e. there can be multiple
comments for a customer.)
 
T

TSnow

I have a question for Allen...If I want to combine all the comments into
another comment memo field, in another table, how can I do that sequentially
when there are more than one comment in the original? I want to do this so
when I run a report for a uunique record that has multiple comments, it will
not create multiple rows of repetitive data...
 

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