Button to open report of specific item

mcgraw

Registered User.
Local time
Today, 13:26
Joined
Nov 13, 2009
Messages
77
First off, I apologize, but I am not adept at Access 2007 yet, and am still fumbling through some basic tasks, BUT...I have a report setup called rptFullDetails that contains all the information I want to report on.

I put a command button on my Issue Details form that will load the rptFullDetails report, but currently it is pulling from every issue, as opposed to the specific one my form has open. How do I link the report to the form so it will only print the specific item I have open?

Thanks!
 
OK...I officially hate Access. :-)

This is what the Macro starts with before I start messing with it:

Full Details, Report, , , Normal

So I tried "ID = '" & me.ID & "'" in the where condition...

I, being naive and full of hope, hit RUN! and it says WTF are you talking about? What is me.ID?

And my hopes are dashed, and I am left saying...(expletives removed for professional courtesy)...

"ID" is the primary key of the issues table, so both ID in the form and in the report should match...I'm confused!
 
Sorry, I gave you VBA code because it wasn't clear that you were using macros.

The argument in the macro should be:

If ID is numeric:
"[ID]= " & [Forms]![YourFormNameHere]![ID]

If ID is text:
"[ID]= '" & [Forms]![YourFormNameHere]![ID] & "'"
 
Thanks!

Where you have Forms!, since I am running reports, I assume I want to change that to Report and MyReportNameHere correct?

Or is the first instance of ID calling the report ID, and the second is the Form ID?
 
Thanks!

Where you have Forms!, since I am running reports, I assume I want to change that to Report
NO, you don't. You want the FORM! part because in that argument you are wanting the record that matches that form.

Or is the first instance of ID calling the report ID, and the second is the Form ID?
Yes, that is correct. The first [ID]= part is referring to the ID on the REPORT where the second part is matching to the form.
 

Users who are viewing this thread

Back
Top Bottom