Solved

Open report for a sepicific record.

Posted on 2012-03-27
2
553 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

18 Experts available now in Live!

Get 1:1 Help Now