Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Automatic Date and Text in Comments box

Status
Not open for further replies.

cmc2000

Programmer
May 14, 2003
20
0
0
US
I have a box for comments in my app. When i print out letters i would like the date, and some text saying letter 1 sent to go into a comment box in the layout. I also wanted to know what i would have to do so that when i enter text into the comment box, it would automatically assign a date and time to that text.

Thanks for any help
Brandon
 
-When i print out ...
header-footer

-automatically assign a date and time to that text
some field with an auto insert of a current time or date that needs to be displayed through the reports and then printed.
All the best!
 
This can be done with your print script.

Print script //add this on to your existing script//

SETFIELD(History, history&"paragraph symbol"&dateformula&" Letter sent: "&lettername)

The paragraph symbol puts a carrage return in the history so the field can stack the history using one line for each history entry. This will allow you to print or view the history and have it displayed in a cronological order. Switch the history and the rest of the code and the latest entry will be displayed on top of the past history.

This concept can track as many letters sent as you would like

The history in this case stacks the letters sent and the results could look like this in the history field:

6/10/2003 Letter sent: Thank you
6/12/2003 Letter sent: referral request
6/15/2003 Letter sent: Time to reorder

This script allows you to keep the current history without erasing the old history.

When building this script keep in mind you do not want the history to post unless the letter was sent. So factor in your script what happens when the user says print this letter then cancels it prior to printing.

I hope this helps. Let me know if you have any scripting quesitons to make this work.

Marty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top