why: when i convert macro to VBA open report not working?!

siamandm
BronzeLounger
Posts: 1226
Joined: 01 May 2016, 09:58

why: when i convert macro to VBA open report not working?!

Post by siamandm »

Hello All
I have a button to open a report, with click event created with macro working fine and opens the required report, but when I write a code to open the same report or I click convert macro to VBA code ... the click button is to open the report any more
any suggestions, please


Regards

User avatar
HansV
Administrator
Posts: 78475
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: why: when i convert macro to VBA open report not working?!

Post by HansV »

What is the code you wrote?
What does the code converted from the macro look like?
Best wishes,
Hans

siamandm
BronzeLounger
Posts: 1226
Joined: 01 May 2016, 09:58

Re: why: when i convert macro to VBA open report not working?!

Post by siamandm »

it is something like this :

Code: Select all

DoCmd.OpenReport "rptCalc", acViewPreview, "", "", acNormal

siamandm
BronzeLounger
Posts: 1226
Joined: 01 May 2016, 09:58

Re: why: when i convert macro to VBA open report not working?!

Post by siamandm »

Dear Hans
I have figured out the issue, which caused by checking something in the trust centre as shown below:
trustCenter.jpg
so after checking back show the message bar in all.....
now the VBA codes do what they suppose to do.


thank you very much for your continuous support

Regards
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78475
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: why: when i convert macro to VBA open report not working?!

Post by HansV »

Congratulations on finding it yourself - it would have been difficult to guess that.
Best wishes,
Hans

siamandm
BronzeLounger
Posts: 1226
Joined: 01 May 2016, 09:58

Re: why: when i convert macro to VBA open report not working?!

Post by siamandm »

Thank you very much :)