B
Bruce
I have a form that includes a command button to print the
report that is based on the current record. However, when
I fill in the information and print, I end up with a blank
form unless I go to the previous record, close the form,
or some other activity. I know I can add a Save button to
the form, but I would prefer that each field be saved as
it is entered, or otherwise have it so that when the print
button is clicked it prints the information I just entered.
Perhaps save and print could be a combined button?
I used the command button wizard to add a Print button to
the form, and added code (provided in this forum) so that
it prints only the current record. This is the code to
which I would add a Save command, if that is the best
choice for my needs:
Private Sub cmdPrintForm_Click()
'Open the report to display only the current record
Dim DocName As String
Dim LinkCriteria As String
stLinkCriteria = "[ID]=" & Me![ID]
stDocName = "rptSpecReview"
DoCmd.OpenReport stDocName, acNormal, , stLinkCriteria
Exit Sub
End Sub
cmdPrintForm is the command button, [ID] is the record's
unique identifier, and rptSpecReview is the report that is
printed by clicking the command button.
report that is based on the current record. However, when
I fill in the information and print, I end up with a blank
form unless I go to the previous record, close the form,
or some other activity. I know I can add a Save button to
the form, but I would prefer that each field be saved as
it is entered, or otherwise have it so that when the print
button is clicked it prints the information I just entered.
Perhaps save and print could be a combined button?
I used the command button wizard to add a Print button to
the form, and added code (provided in this forum) so that
it prints only the current record. This is the code to
which I would add a Save command, if that is the best
choice for my needs:
Private Sub cmdPrintForm_Click()
'Open the report to display only the current record
Dim DocName As String
Dim LinkCriteria As String
stLinkCriteria = "[ID]=" & Me![ID]
stDocName = "rptSpecReview"
DoCmd.OpenReport stDocName, acNormal, , stLinkCriteria
Exit Sub
End Sub
cmdPrintForm is the command button, [ID] is the record's
unique identifier, and rptSpecReview is the report that is
printed by clicking the command button.