Hi all,
I fairly new to Access so bare with me...
I am creating a data base that has two tables.
Table one is called Route Sheet and has a Primary key "Part Number"
Table two is called Operation Info and has two keys "Part Number" and "Operation Number"
The relationship is one to many --> "One" Part Number in Route Sheet to "Many" Part Numbers in Operation Info
I have a form called "Route Sheet Form" that has data entry stuff for all the fields in Route Sheet Table AND has a subform called "Operation Info subform" that displays all the fields in Operation Info Table for the particular part number selected.
I want to add a print button to the form to print only one record (the record that is currently selected) at a time. I created a Report from my "Route Sheet Form" and called it "Route Sheet Report"
I have looked over this website http://support.microsoft.com/kb/209560
I added a command button for printing to a report, and wrote the following for the On Click event
But the button still reports everything, not the single Part NumberCode:Private Sub Print_Report_Click() Dim strReportName As String Dim strCriteria As String strReportName = "Route Sheet Report" strCriteria = "[Part Number]=" & Me![Part Number] DoCmd.OpenReport strReportName, acViewPreview, strCriteria End Sub
Can anyone help me?