473,382 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Printing a single record

I'm trying to print out only the current record from my form in a report but each time all the records print out. How can I print only one record using a report.

I have place a button in the report, with the following in the command in the On Click box;

DoCmd.OpenReport "Issues",acViewPreview, , "[ID] = " & Me![ID]

Each time I try to run this I get the following message;

Access cannot find the object DoCmd.

Where am I going wrong?

Steve
Jun 26 '08 #1
1 2186
Stewart Ross
2,545 Expert Mod 2GB
Hi Steve. There is nothing at all wrong with your attempt to open the report using the specified ID filter. I am assuming that it was a typo when you say you placed a command button on the report - you surely meant a selection form of some kind? (It would make no sense at all to have a command button opening the report on the report itself...)

Assuming as mentioned that your command button is on a form, the ominous problem is the lack of recognition of the DoCmd, which is an essential part of VBA for Access. Is this not recognised throughout your application, or only with this one form? If the problem is limited to the one form, could you post the code in which your DoCmd is placed, so we can check it for you?

If DoCmd is not recognised at all it sounds like a problem with missing project references - the DLL libraries that your code uses - though I can think of no explanation for it at present. To check your references, in the VBA code window select Tools, References. I attach a screenshot of the references for one of my databases so you can see what to look for.

-Stewart
Attached Images
File Type: jpg ScreenHunter_1.jpg (18.4 KB, 151 views)
Jun 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Jeroen van vliet | last post by:
I have a program that when clicked i want to print 2000 papers, with the names adress etc of customers. So it have to print every record. How to manage it? Jeroen
4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
0
by: JF Turcotte | last post by:
Hi I'm unsuccessfully trying to print a form's image under VB.NET. To print under .NET is a real pain in the , I find it to be complex, lenghty, confusing, upsetting and ultimately not to be...
4
by: John Baker | last post by:
Hi: I have a form, which contains a sub form (Employee main record and payment record). It all shows up fine in a screen view, but when I come to print it I find that I cannot get the sub form...
1
by: Marc | last post by:
Can anyone help me! I'm trying to create an automatic printing process involving an Access database, at present I have 9 different reports set out, what I want is each report to print out using...
5
by: John | last post by:
Hi If I have a form open, what is the code that is equivalent to using the File->Print menu with select record(s) option to print the form with the currently displayed record values? Thanks ...
4
by: Rob T | last post by:
I have a small VB program that has a printing module...very simple....and works great. However, If I try to print to a generic printer, I get the following error: "The data area passed to a...
7
by: Dave | last post by:
Hi all I have a student database where I would like to be able to print just one mailing label, for the student whose record I am currently accessing on the form. I want to be able to click on...
6
by: jweaver | last post by:
I have set up an event to print a single record report in access with the criteria below, however each time I enter a claim ID to preview a report, I am able to see the correct claim ID but the...
2
by: Simon | last post by:
Dear reader, In case a report is a sub report the Report Header of the sub report is printed in the report but the Page Header of the sub report will not be printed. This is the same for...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.