View Full Version : Button on report


Xenix
11-29-2001, 02:48 AM
Can anyone help me with this:
In Access I can still use the toolbox to put a command button on the the report, but when you try to press it in view mode the display switches to print preview as it does in report preview mode http://www.access-programmers.co.uk/ubb/frown.gif How can I get the button to work, all it will do is email that report?

Thanks
Mike

Rich
11-29-2001, 05:05 AM
Use a custom menu bar.

Xenix
12-03-2001, 01:09 AM
Thank you Rich,

but the problem is I want to use the command:
DoCmd.SendObject acSendReport, "QuotationEMail", , Me.[Emailaddress], , , "Honda Connectors Ltd.", , True

and I don't know how to do it? I want it to email a report which is controlled by giving the quote number to the report and then is displays that record, but this command don't pass the quote number like a standard search so only works for the first record only http://www.access-programmers.co.uk/ubb/frown.gif
the search code is:

DoCmd.OpenReport "QuotationEMail", acPreview, "", "[Quote]=[Forms]![Quotation]![Quote]"

Can anyone advise me?

Pat Hartman
12-03-2001, 05:35 AM
Think of forms as "live" and reports as "dead". The button you place on a report is merely a picture of a button, not a "live" button with attached event procedures. To solve your problem, you'll need to use a parameter query rather than an external filter. In the criteria line for the [Quote] column place:
=[Forms]![Quotation]![Quote]