Print just the current record showing on the form

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
 
C

Chris

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
 
C

Chris

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.
 
D

Duane Hookom

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top