Printing one field on a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that Deals with hazardous material's MSDS (Approx 200 items). I
was wanting to put a command button on the form that prints just the MSDS for
that record. in looking, i couldn't find it. Maybe i'm looking in the wrong
place. could someone help. Thanks.
 
You want to print one field? On an entire sheet of paper?

You need to build a report. The button you click would open the report and
send it to the printer. After you build the report, the button wizard will
let you select it.

If you want to print the report for the current RECORD on your form, you
could use code like below...


Private Sub Print_Button_Click()

If (IsNull([MSDS])) Then

' Verify the key field (MSDS) has a selection

Exit Sub

End If

DoCmd.OpenReport "SomeReportName", acViewNormal, "","[MSDS] =
Forms![frmSomeFormName]![MSDS]"

End Sub







Hope that helps,





Rick B
 
Back
Top