Solved

Open report for a sepicific record.

Posted on 2012-03-27
2
560 Views
Last Modified: 2012-03-27
Hi, I am using access 2010 vba on access 2010 database.

I need to open a report only for a specific record.

Thanks in advance.
0
Comment
Question by:baabaa_nl
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 350 total points
ID: 37773872
use a where clause to filter the report

place this in the click event of a command button in a form

private sub cdmOpenreport_click()

docmd.openreport "reportName", acviewpreview,, [RecordID]=" & me.RecordID

end sub


me.RecordID is the control in the form that gets the recor id selected



post the codes that you are using
0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 150 total points
ID: 37773880
Docmd.openreport "reportname", acviewpreview,,"id=" & me.txtId


TxtId is a textbox containing the desired id
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now