473,396 Members | 2,004 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,396 software developers and data experts.

How to open a report with a determine field (primary key)

Hello, I want to make a report for a single compressor. Instead of
showing a report for all the compressors. I would like to place a
button in the compressor form, so whenever I want to display a report
from that particular compressor I click the button and the report will
show ONLY that compressor. Each compressor has it own primary key. So i
guess I need to match that pk with my report. Can somebody give me some
ideas ? I am pretty familiar creating reports but I just dont know how
to create a report for a particular data in a particular field

Thankssss

Jul 21 '06 #1
6 1709
"erick-flores" <ch**********@hotmail.comwrote in
news:11*********************@s13g2000cwa.googlegro ups.com:
Hello, I want to make a report for a single compressor.
Instead of showing a report for all the compressors. I would
like to place a button in the compressor form, so whenever I
want to display a report from that particular compressor I
click the button and the report will show ONLY that
compressor. Each compressor has it own primary key. So i guess
I need to match that pk with my report. Can somebody give me
some ideas ? I am pretty familiar creating reports but I just
dont know how to create a report for a particular data in a
particular field

Thankssss
you can open any report filtered to any expression using the
where parameter of the .openreport method of Docmd

in the OnClick event of the button that opens the form,

Dim stDocName as string
Dim stwhereclause as string

stdocname = "myReport"
stwhereclause = "primaryKey = " & me.txtPrimaryKey
docmd.openreport stdocname,,,stwhereclause

The Wizard does the same thing.
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 21 '06 #2

Got it thankss

Jul 21 '06 #3

Hello

OK now, I realize it is showing all the records after the primary key
of the compressor. I though it was going to take only the records
related to that primary key. What I mean is:
Compressor-->Stages-->Cylinders-->Gaskets.... the compressor primary
works fine it shows only the one that is currently displaying on the
form but then it shows all the stages for all the compressors and all
the cylinders for all the compressors and so forth. Is there a way to
link all the records so that only shows one compressor, only the stages
for that compressor, only the cylinders for that compressor, only the
gaskets for that compressor and so on. Any ideas?

Thanks

Jul 21 '06 #4
If your Tables are properly designed and your Report is properly Grouped by
Compressor, selecting the specific CompressorID should give you what you
want. Maybe if you were to clarify your Table / data layout, and some
details on how you created the Report, someone could offer useful
suggestions.

Larry Linson
Microsoft Access MVP

"erick-flores" <ch**********@hotmail.comwrote in message
news:11**********************@75g2000cwc.googlegro ups.com...
>
Hello

OK now, I realize it is showing all the records after the primary key
of the compressor. I though it was going to take only the records
related to that primary key. What I mean is:
Compressor-->Stages-->Cylinders-->Gaskets.... the compressor primary
works fine it shows only the one that is currently displaying on the
form but then it shows all the stages for all the compressors and all
the cylinders for all the compressors and so forth. Is there a way to
link all the records so that only shows one compressor, only the stages
for that compressor, only the cylinders for that compressor, only the
gaskets for that compressor and so on. Any ideas?

Thanks

Jul 21 '06 #5
"erick-flores" <ch**********@hotmail.comwrote in
news:11**********************@75g2000cwc.googlegro ups.com:
OK now, I realize it is showing all the records after the primary
key of the compressor. I though it was going to take only the
records related to that primary key. What I mean is:
Compressor-->Stages-->Cylinders-->Gaskets.... the compressor
primary works fine it shows only the one that is currently
displaying on the form but then it shows all the stages for all
the compressors and all the cylinders for all the compressors and
so forth. Is there a way to link all the records so that only
shows one compressor, only the stages for that compressor, only
the cylinders for that compressor, only the gaskets for that
compressor and so on. Any ideas?
Sounds like you have subreports on your main report that are not
filtered by the link properties.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jul 21 '06 #6

I checked my grouping and the problem was in there, thanks

Jul 21 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: P | last post by:
Hi, Access 2002. I am trying to use the PrintOut function to print the current record of the current open form in landscape format to the default Windows printer. Any suggestion on how to set...
1
by: Megan | last post by:
quick summary: i'm having problems trying to group fields in a report in order to calculate percentages. to calculate percentages, i'm comparing the results from my grouped fields to the totals....
5
by: Sami | last post by:
I can create queries and reports based on info from one table. How do I create one using information from multiple tables. What do I need to make sure the information from one table will be...
2
by: braley | last post by:
I am using MS Access 2003 and am in the process of creating a database that contains contact information and attendance data for a group of volunteers. I have created a table that contains all of...
1
by: pemigh | last post by:
I have a report with pages breaking in the middle of text box controls. And it's not just on a line-by-line basis, but sometimes (in a situation that I can no longer recreate) just the bottom...
1
by: Andy_Khosravi | last post by:
I'm having trouble building a query to gather the information I need from a table. I need to be able to assemble an inventory report that displays receipts, output, and running inventory from a...
9
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo...
1
by: mark_aok | last post by:
Hi all, I have a situation where I need to determine a specific table's primary key, and then output it. I have tried the Database Object, and the Record Object, but I've had no luck. ...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.