Generate a report from a specific record

C

Charles Agin

I am posting this question again because the first I posted it and received a
notification that there was a reply, but I was unable to see the reply.

I need to see how I can have a report generated from a specific record from
a form (query). For example, I have a form where user input inspection data
for a site. I have a button that they click to bring up a specified report,
but I would like to have that report based on the specific record instead of
all the records associated with the query.

Any assistance/advice is appreciated!

Please email responses to (e-mail address removed) also.

Thanks!
 
D

Dale Fye

Charles,

How are you opening the report? If you have a command button, that has code
behind it, the code probably looks something like:

docmd.openreport "reportname"

The OpenReport method (look this up in help) has several other parameters
that can be passed to it. One of them is a WHERE clause, which is how you
take a generic report, and customize it to only run for specific records.
Assuming that your reports record source contains a field that uniquely
identifies it (I'll call this [ID]), and that your form contains a control
(txt_ID) which contains a similar value, then you should change the line
above to read something like:

docmd.OpenForm "formname",,,"[ID] = " & me.txt_ID

HTH
Dale

BTW: If you are going to post to newsgroups, it is considered impolite to
request that responses be sent to your email. Those of us that take the time
to respond to these posts, do so so the entire community may benefit.

I'd also advise against putting your email address in the clear on the
groups because there a SpamBots that go to these newsgroup sites, read the
posts, and search for strings that look like email addresses. They then
harvest the address and use it or sell it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top