Help with Form and Report

G

Guest

I have inherited a database that has numerous date fields more than 3.
Everytime correspondence was sent a date was entered manually. How can I
correct this? I would also like to have a date entered automatically on form
when report is printed. Meaning I would like the print date stamped on form.
However, if report needs to be sent more than once I would like each
different date print to be entered on form for each record.
 
J

John W. Vinson

I have inherited a database that has numerous date fields more than 3.
Everytime correspondence was sent a date was entered manually. How can I
correct this? I would also like to have a date entered automatically on form
when report is printed. Meaning I would like the print date stamped on form.
However, if report needs to be sent more than once I would like each
different date print to be entered on form for each record.

You can put today's date (date printed) on a Report by simply putting a
textbox on the report with a Control Source of

=Date()

This date won't be recorded anywhere and there will be no record of when the
report was printed - it's not clear whether you want that information!

John W. Vinson [MVP]
 
G

Guest

John W. Vinson said:
You can put today's date (date printed) on a Report by simply putting a
textbox on the report with a Control Source of

=Date()

This date won't be recorded anywhere and there will be no record of when the
report was printed - it's not clear whether you want that information!

John W. Vinson [MVP]
 
G

Guest

Thank you for responding. Yes I do want the date print to be recorded back
to my form. I do not want to have to go back to the form and enter it
manually. How do I do that?

I have a main form and subform. When I look up a doc, I get a list of pts.
I have a command button that calls the report for these patients. When I
send this report, I want the "date Print" to be recorded on the subform.
Thank you.
 
J

John W. Vinson

Thank you for responding. Yes I do want the date print to be recorded back
to my form. I do not want to have to go back to the form and enter it
manually. How do I do that?

You can't store a date in a Form. A Form doesn't store *ANYTHING* - it's just
a window. Data is stored in tables, and *only* in tables.
I have a main form and subform. When I look up a doc, I get a list of pts.
I have a command button that calls the report for these patients. When I
send this report, I want the "date Print" to be recorded on the subform.
Thank you.

So you want the date stored in the Subform's recordsource table? What is the
Recordsource of the subform? Is there data in that table currently, or do you
need to add a new record to the table? Either will be possible - but you'ld do
it differently (setting a value on the subform or running an Append query to
the table respectively).

John W. Vinson [MVP]
 
G

Guest

Sorry, about the confusion. Yes I know you cannot store any data on a form.
Yes I want to store the date print on the form's table date field. How do I
go about getting the date the report is printed for a specific record to be
stored on the table's date field? Thank you.
 
J

John W. Vinson

Sorry, about the confusion. Yes I know you cannot store any data on a form.
Yes I want to store the date print on the form's table date field. How do I
go about getting the date the report is printed for a specific record to be
stored on the table's date field? Thank you.

Sorry to be persistant here but I don't want to give you bad advice, or for
that matter help you further with a faulty design!

WHICH table has "the date field"? What is the Recordsource property of the
mainform (perhaps post the SQL or the fieldnames in the table)? What is the
Recordsource property of the Subform? (again, post the SQL or the fieldnames)?
Do you want to *UPDATE* a date field in an existing record, overwriting
whatever data happens to be there already; or do you want to create a *new
record* for each report printed?

You presumably have a command button on the Form to print the desired report
(if not, that would be the simplest way to do this both for you and for the
user). That command button could have code in it to store this date field.
I'll be glad to help with the code... once I figure out just where you want
the date field stored!

John W. Vinson [MVP]
 
G

Guest

I appreciate any help I can get. Recordsource property of the mainform is
"tblDr". This table holds Dr info. My subform is "tlbpts". This table
holds pt info and date field (RMDNR) for when reminders go out and date field
for visits(VST). My mainform is linked to the subform by DrID. Yes I do have
a command button on main form to generate report. When I generate a VC RMDR
report I want the date I print this report to populate the RMDR date field.
Here is the code for the report. The report has a text box with control
source of "Now()". I would like this date to fill the RMDR date field in my
"tblpts". I would like to update the RMDR date field. However, I would also
like to know how to create a "new" record for each report printed. I am new
to code and I appreciate your patience. Thank you.


Private Sub VC_RMDR_Click()
On Error GoTo Err_VC_RMDR_Click

Dim stDocName As String

stDocName = "rpt VC RMDR"
DoCmd.OpenReport "rpt VC RMDR", acPreview, , "[DR ID]=" & Me![DR ID]

Exit_VC_RMDR_Click:
Exit Sub

Err_VC_RMDR_Click:
MsgBox Err.Description
Resume Exit_VC_RMDR_Click

End Sub
 

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