Hi Fredg,
I really appreciate for your help!
Each patient's letter is one report?
I created only one report that will sent to all patients.
Ex: In the report's page header, I inserted Lastname field, firstname field
and date (). Therefore, the patient's name is changed. It looks like mail
merge in Word.
In the report's detail, I entered the letter so that it stays the same for
any patients.
--------------------
Yes! I created a parameter update query to the table's [SendDate] field. It
works, but it requires a lot of data entry. Ex: the table has 100 patients
and only 50 of them are eligible. Therefore, I have to enter the date for 50
times in the parameter boxes.
Please tell me what I should to do?
Thanks
Chi Huynh
fredg said:
On Mon, 29 Oct 2007 09:38:45 -0700, fredg wrote:
On Mon, 29 Oct 2007 07:52:03 -0700, Chi wrote:
Hi
I created a letter report that will send to all patients. It works fine!
In the report page header, I inserted "=date()" so that it shows the current
day.
Is there a way that makes the current day automatically entered to the form
or table when the letter is printed off?
Ex: The current day will be inserted automatically in the "Senddate field"
when the letter is printed off.
Thank you
Chi
Each patient's letter is one report?
You could run an update query in the report's Report Footer Print
event to add the date to the table.
CurrentDb.Execute "Update YourTable Set YourTable.[SendDate] = Date
Where YourTable.[PatientID] = """ & Me![PatientID];", dbFailOnError
Note: The table will be updated even if the report is just previewed,
without printing.
However, even if a report has been sent to the printer .... it may
not have been successfully printed. Printers do run out of paper, ink,
etc.
It would be best to code a command button on your form to update the
table's [SendDate] field.
Any future letters to the same PatientID will update the same SendDate
field.
Oops, assuming [PatiendID] is a Number datatype, that should have
been:
CurrentDb.Execute "Update YourTable Set YourTable.[SendDate] = Date
Where YourTable.[PatientID] = " & Me![PatientID], dbFailOnError
However if [PatiendID] is actually a Text datatype, then use:
CurrentDb.Execute "Update YourTable Set YourTable.[SendDate] = Date
Where YourTable.[PatientID] = """ & Me![PatientID] & """;",
dbFailOnError