|
|
Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
I previously posted a question regarding openreports() . I guess there is no openreports() function in Access , unless it is created as a macro( right?). Anyway, I am still working on this problem. In the on-click event to send a report to email, there is this : =OpenForms("logentry"). Ok. It works, even though logentry is not a form, but a report. But, it sends out an error message telling me that there is no such form as 'logentry', which is correct. So, my question is: How do I get this to open the report so i can send it? I dont understand why it even works.
I hope that's enough information to go on.
thanks a lot.
|
|
Maggie,
As I told you before, there is no such thing as OpenForms() function in Access. The fact that you are successfully using a function named OpenForms() means that this has been created as a customised function in your database. This would be in a standard module, not in a macro - you can't use a macro to create a function. But since it is not part of Access core functionality, no-one can really comment about it, since we have no idea what it is.
The standard approach to using a macro to email a report would be to use a macro with the SendObject action.
-- Steve Schapel, Microsoft Access MVP
Maggie wrote:
[Quoted Text] > I previously posted a question regarding openreports() . I guess there is no > openreports() function in Access , unless it is created as a macro( right?). > Anyway, > I am still working on this problem. In the on-click event to send a report > to email, there is this : =OpenForms("logentry"). Ok. It works, even > though logentry is not a form, but a report. But, it sends out an error > message telling me that there is no such form as 'logentry', which is > correct. So, my question is: How do I get this to open the report so i can > send it? I dont understand why it even works. > > I hope that's enough information to go on. > > thanks a lot.
|
|
Hi Maggie,
I agree with Steve. The method you need to use is OpenReport().
Here is an article for your reference.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/htm l/acactOpenReport_HV01122153.asp
Hope this will be helpful!
Sincerely,
Wei Lu Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue.
================================================== This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
Thank you for your comments, Wei.
However, when you write OpenReport() with the () at the end, it makes it look like a Function. As you know, there is no such thing as an OpenReport() function in Access. As you will be aware from reading the earlier posts in this and earlier threads, I have been trying to assist Maggie to distinguish between the OpenReport and OpenForm macro actions, and the OpenReport and OpenForm methods of the VBA DoCmd object, versus the user-defined functions that have apparently been written into her application. Apparently Maggie has been confused about this, so I hope you can clarify.
-- Steve Schapel, Microsoft Access MVP
Wei Lu [MSFT] wrote:
[Quoted Text]
|
|
Hi Steve,
Thanks for the advise. I really appreciate your help in the newgroup. I would like to discuss with you in the future. Thanks!
Sincerely,
Wei Lu Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue.
================================================== This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
Hi Maggie,
As Steven mentioned, the OpenForm and OpenReport method in the VBA is different with the function in the marco.
Based on your discription, I think you need to use the OpenReport Method in the VBA code.
The following example prints Sales Report while using the existing query Report Filter.
DoCmd.OpenReport "Sales Report", acViewNormal, "Report Filter"
This article discribes the OpenReport Method:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/htm l/acmthactOpenReport_HV05186500.asp
And this article discribes the OpenReport action:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/htm l/acactOpenReport_HV01122153.asp
Hope this information is helpful!
Sincerely,
Wei Lu Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue.
================================================== This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|