Print a canned report based on info fromf the form

C

CAM

Hello,

I have a form based on a table with 50 records and growing I set the form to
"Data Entry" = Yes so the user can enter the data only. Reviewing previous
data is not necessary. I made a canned report and somehow I want to tie the
already made report with the data the user just entered via a comman button.
I don't want to print all the 50+ records, just the one the user entered.
This is for an insurance company the report will show policy number, insured
name, formulas, etc. I don't want to print the form, because I have
formulas in my report. How do I do this? Any suggestions or web site to
visit will be appreciated. Thank you in advance.
 
G

Guest

Assuming the record the user just entered has a primary key, open the report
with a criteria set to that primary key.

You could have a report button on your form. WHen clicked, the code behind
the button might be something like:

DoCmd.OpenReport "MyReport",,,"[MyPrimaryKeyID]= " & Me.MyPrimaryKeyID

This would cause your report to open with just that record.
 
R

Rick A.B.

CAM,
You need to tell the report which record to print by adding a where
clause to your print command.
Something like;
Dim stDocName as String
stDocName="NameOfReport"
DoCmd.OpenReport stDocName, acNormal, , "[Identifying field on report]
= " & Me![Identifying field on Form]
 

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