G Greg Ripper Dec 18, 2003 #1 What is the button code to have a report, rptDiscipline, print just the current record on the form, frmPaperwork? Rip
What is the button code to have a report, rptDiscipline, print just the current record on the form, frmPaperwork? Rip
F fredg Dec 18, 2003 #2 Greg said: What is the button code to have a report, rptDiscipline, print just the current record on the form, frmPaperwork? Rip Click to expand... Add a Command Button to your Form. Code it's Click event: DoCmd.OpenReport "rptDiscipline",acViewPreview, , "[RecordID] = " & [RecordID] The above assumes your table has a unique prime key field named [RecordID] and it is of Number Datatype. Change [RecordID] to whatever the actual name of that field is. Change acViewPreview to acViewNormal to print the report without preview. If [RecordID] is a Text Datatype then use: "[RecordID] = '" & [RecordID] & "'"
Greg said: What is the button code to have a report, rptDiscipline, print just the current record on the form, frmPaperwork? Rip Click to expand... Add a Command Button to your Form. Code it's Click event: DoCmd.OpenReport "rptDiscipline",acViewPreview, , "[RecordID] = " & [RecordID] The above assumes your table has a unique prime key field named [RecordID] and it is of Number Datatype. Change [RecordID] to whatever the actual name of that field is. Change acViewPreview to acViewNormal to print the report without preview. If [RecordID] is a Text Datatype then use: "[RecordID] = '" & [RecordID] & "'"