Report printing

ELaJaunie

Registered User.
Local time
Today, 10:39
Joined
Sep 2, 2003
Messages
11
Okay, I hope you guys can help me out here. I'm VERY new to Access (using Access 2000), but I've made quite a bit of progress.

I had taken an inventory of all my firm's computers and put it in a spreadsheet in Excel, but since that would be too much work to update whenever people arrive/leave and new computers come in, etc, I figured it would be easier to put it into a database. So I imported my spreadsheet, made a query, created my data entry form and created two separate reports. One is a spreadsheet report that lists everything, but the other is an "individual" report that has all the info for each separate computer on a separate page. Now, on my form I have text boxes for my data entry and print and print preview buttons for my reports. The spreadsheet works fine, but I cannot get the "print individual report" button to work how I want it to. Say I go to record 24 on my form and I want to preview/print that particular individual report. When I hit the preview button, it opens the individual report, but it only opens record 1. And if I were to make a print button on the form for my individual reports, it would print out that entire report (and that's over 80 pages that I don't want to print out all at once... yet). So is there a way that I can make it open the report at the record currently being viewed by the form, and/or print only that specific report?

Any help will be greatly appreciated.
 
On the query that creates the report for the particular individual report in the criteria reference the form unique record id, which should be something like computerno?

post the db if no joy and it will get looked at!
 
I'm sorry, now I'm confused.

Let me give you a rundown of what I have (it's a very simple inventory right now)...

My table has these fields
ID (Primary Key) - Autonumber
MODEL - Text
PROCESSOR - Text
OS - Text
RAM - Number
USERNAME - Text
NOTES - Text

My one query runs off of all of these fields on this table.

My form has text boxes and command buttons to enter data into the records, which also runs off of that query.

I have two reports - one spreadsheet that lists most of that data, and that works like a charm, and my individual computer report that has all the data for each computer on a seperate sheet. Both of my reports run from that same query because the data won't sort if I run them from the table (they sort by USERNAME).

What am I to reference in the criteria of which field in my query? I'm just a little confused.

I would think that the problem would lie in the Event Procedure for the print / print preview command buttons. Here's the code I have for the print preview button (I think the print command is similar, but I took that out out so no one would hit it and print out 80+ pages)...

Code:
Dim stDocName As String

    stDocName = "Computer Inventory Report"
    DoCmd.OpenReport stDocName, acPreview

It's basically the same for my spreadsheet report, but that's how I want it to look for that report. But isn't there some way to tell it to open the individual report to the record that the form is viewing and then print ONLY that portion of the report?

I apologize for how simple this must be to some of you, but it's really stumping me as I have a VERY poor grasp of VB and I'm the only one around this firm who can even remotely do this stuff (for free, no less).
 
Create the same query and in the ID (Primary Key) - Autonumber field criteria RightClick and then build a link to the form ID (Primary Key) - Autonumber and then build the report on that query and then it will only return that record.

post the db and i'll do it 4 u?
 
If you can get it to work, I'd be eternally grateful. I created a query for each report and a separate query for the form. I tried building a link, but I kept getting a parameter input box for some reason. The reports are rough, but they're not yet complete. I want to get the printing working how I want it to before I finish them (just in case I have to rebuild them).
 

Attachments

SWEET! Can you explain to me (in english) how you did it? That's *exactly* how I wanted it to work.
 
Nevermind, I see what you did! It's all so clear now. Thanks sooooo much!

*happydance*
 
So simple when you see how.
As I has said in the past I still do this in Macros. And have always wondered how it was done in VBA.
Nice download, thanks for that.
 

Users who are viewing this thread

Back
Top Bottom