• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 940
  • Last Modified:

how to create command button on form that when clicked print previews form for current record

hi
How can I create a macro to attach to a command button that will print preview only the current record? I can use the button wizard but it prints, doesn't allow me to print preview. I want to create a button that when the user clicks on it - it just previews the current form. thanks! Or if not a macro, some other way?

0
agwalsh
Asked:
agwalsh
  • 2
  • 2
1 Solution
 
mbizupCommented:
Use VBA in the Click Event:

Docmd.OpenReport "YourReportName", acViewPreview,, "[IDFieldName]  = " & Me.IDField
0
 
mbizupCommented:
In explanation, that opens your report, filtering it to a particular ID, based on the ID that is currently showing on your form.
0
 
agwalshAuthor Commented:
Will this work for a form as well? Just to change OpenReport to OpenForm?
0
 
agwalshAuthor Commented:
Worked like a dream! Thank you !!1
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now