opening a report -

G

Guest

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.
 
S

Steve Schapel

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.
 
W

Wei Lu [MSFT]

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.
 
S

Steve Schapel

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.
 
W

Wei Lu [MSFT]

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.
 
W

Wei Lu [MSFT]

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.
 

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