By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,677 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,677 IT Pros & Developers. It's quick & easy.

Opening a single, particular report

stonward
100+
P: 145
Hi Guys,

I have a main form, based on a query, with a subform based on another, that is used primarily for data input. The whole thing is my QUOTATION form. I want to print (view first) this, and a report is the best method - yes?

How do i get Access to view/print just the current record (or latest ID number) - at present it's always opening/printing ALL the quotations from the table. I've tried using a version of the code for opening a particular form, but that doesn't work.

I've been trying now for several nights and have failed miserably!

Thanx,

Stonward Roy.
Aug 31 '07 #1
Share this Question
Share on Google+
3 Replies


Scott Price
Expert 100+
P: 1,384
Hi Guys,

I have a main form, based on a query, with a subform based on another, that is used primarily for data input. The whole thing is my QUOTATION form. I want to print (view first) this, and a report is the best method - yes?

How do i get Access to view/print just the current record (or latest ID number) - at present it's always opening/printing ALL the quotations from the table. I've tried using a version of the code for opening a particular form, but that doesn't work.

I've been trying now for several nights and have failed miserably!

Thanx,

Stonward Roy.

Hi there Stonward,

Here's a brief overview: Create a separate query. If you are wishing to view only record from the main form you can create an exact copy of your main form's query, likewise with the subform. In the design view of the query you will find the column that returns the unique recordID for your form/subform. Enter criteria like this: Forms![YourMainFormName]![IDControlName], where you replace the middle value here with the name of your main form, and the last value with the name of your text box, etc that contains the record id. Base the report on this query.

Now when you open your report (using a command button on the main form, hint hint :-) you get the report filtered by the query to return only the record you are viewing on the main form.

Regards,
Scott
Aug 31 '07 #2

missinglinq
Expert 2.5K+
P: 3,532
If you already have a report that prints out the data you want for all records, and just want the report for a given record, this should do the trick:

Expand|Select|Wrap|Line Numbers
  1.  DoCmd.OpenReport "YourReportNameHere", acViewNormal, , "[IDField]= '" & Me.IDField & "'" 
where IDField is TEXT and holds the bit of uniquely identifying record data.

Linq ;0)>
Aug 31 '07 #3

stonward
100+
P: 145
Thanks, guys...sorry for the delay in reply.

yep, that sorted it!

Amazing, but that is nowhere in any of the access books i have...in fact it could be construed that they actually lead one away from the answer!

Got another, somewhat larger issue now. If you fancy it, check it out?

Thanks again.

StonwardR
Sep 3 '07 #4

Post your reply

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