printing from Command Button

A

Andrew McBride

Hi. I'm having extreme dificulty and was wondering if
anyone has any ideas.

I have two tables:
MAIN DATA - which holds things like name, date of
birth, address, etc.
INFO - Which holds information such as order
dates, whether payment has been rec'd, etc.

I then have a query which is created from these two tables
called DATA. The primary key in the tables is called "ref
link".

And then a form for input called INPUT NEW.

When I enter data into the form the query holds all of the
information, and the tables only hold what they need.

What I want is a command button at the bottom of the form
to print a report (called ORDER) which prints the report
with all the fields I need within (sort of like an
invoice). But I only want it to print the record that is
displayed on screen.

Many people have tried to help, but it still won't do it.

Thanks for any halp any of you can give.
 
A

Arvin Meyer

Assuming the RefLink is a number, the line of code you need in a button to
open a report to a specific record should read something like:

DoCmd.OpenReport "MyReport", acViewPreview, , "[RefLink]=" &
[Forms]![MyForm]![txtRefLink]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

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