Print just the current record showing on the form

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have a number of records that I can scroll through on a form. I want to
just print the record that I am currently looking at from a print comand
button. The problem is that this command will print all records.

Does anyone know how to restrict this. I am using Access 2000..

Thanks
 
Hi,

Thanks fopr the quick reply.

I am a bit of a novice with the code. I can make a macro with the open
report but can only use the expression builder. If I try to put the code
into the back of the button direct I get a syntax error when I replace my own
report Name and key field.

The below gives a syntax error.

Thanks


Private Sub Command72_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Work Order Report"
strWhere = "[Work Order No]=" & Me!Work Order No
DoCmd.OpenReport strDocName, acPreview, , strWhere

End Sub
 
Hi Duan,

I figured it out. I had missed some brackets. Thanks you so much for the
help. I have been struggling with this for hours.

Much appreciated.

Chris.
 
It's good to hear you got this sorted out. You have found out why most of us
veteran/old developers subscribe to a naming convention that doesn't allow
spaces in names.
 
Back
Top