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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing current record

Status
Not open for further replies.

Euphorbiaman

IS-IT--Management
Jun 7, 2006
2
US
Hi,
I have a form that loads from a menu option. A combo box on the form allows the nurse to choose a patients name. Once the name is chosen the form is populated with the patients data. The nurse wants to be able to print the current record from a command button at the bottom of the form. When the command button is clicked, instead of the current record printing all 1000+ records print. The form and report are based on the same select query. The query gathers data from 3 tables and SSN is the command field between all three tables. Both the report and form have subforms.

Here is the code:
Dim strReportName As String
Dim strCriteria As String

strReportName = 'New Report 6606"
strCriteria = [Forms]![New Main Form 6706]![SSN]
DoCmd.OpenReport strReportName, acViewPreview, strCriteria

Thanks for your help!
 
Code:
Dim strReportName As String
Dim strCriteria As String

strReportName = 'New Report 6606"
strCriteria = "SSN='" & [Forms]![New Main Form 6706]![SSN] & "'"
DoCmd.OpenReport strReportName, acViewPreview, strCriteria

[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top