• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 872
  • 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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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