使用PP宏以全屏方式打开Access报告 [英] Using PP macro to open an Access report in full screen

查看:98
本文介绍了使用PP宏以全屏方式打开Access报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个培训计划,在前面使用PP打开Access报告,这是测试和答案。这是独立的,没有服务器,没有互联网,信息需要保持动态。起初我尝试使用PowerPoint幻灯片
中的链接到Access,然后在访问中运行宏来打开报告。


C:\Program Files \ Microsoft Office \ Office15 \ MSACCESS.EXE C:\sts\263X.mdb \ x SKTL3P10A


此DID有效,直到您关闭程序并重新打开它。完成此操作后,宏开关/ x将更改为\ x,因此无效。到目前为止,即使Microsft的专业人士也无法解决这个问题,所以我尝试了另一个选择。我在
PowerPoint中编写了一个基本相同的宏,这就是它;


Dim accessApp

设置accessApp = CreateObject(" Access.Application")

accessApp.Visible = True

accessApp.UserControl = True

accessApp.OpenCurrentDataBase(" C:\sts \ 2.63X.mdb")

accessApp.DoCmd.RunMacro" PHSL3P10"

DoCmd.Maximize

frmBackgroundForm.SetFocus



这一直有效,直到我关闭并重新打开程序。当我这样做宏时确实运行但它在后台打开。如果我在PP中进入Macros并点击"运行"我收到一个错误424对象需要。我已经阅读了几个论坛,但没有一个解决方案
似乎与我的问题相符。我承认我不是程序员,所以有一些是我的头脑。最重要的是,似乎PowerPoint和Accesss彼此不能很好地工作,但它是我的全部。我非常接近终点线。有没有人有
a解决方案?

解决方案

Hi Blaster99,


- >再一次这个工作直到我关闭并重新打开该程序。


你的意思是什么?这是否意味着您需要在运行宏之前关闭访问应用程序?你能告诉我更多细节吗?


- >我收到错误424需要的对象


在使用SetFocus之前需要打开表单,所以你需要做像这样

 accessApp.DoCmd.OpenForm(" Form1")
accessApp.Forms!Form1.SetFocus




- >当我这样做时,宏确实运行但是它打开了的背景。


因为我没有"PHSL3P10"中的代码;,我试图用一段相似的代码重现你的问题,代码对我很有用。你是什​​么意思背景?您是否在全屏幕中看到报告
?如果你看,它不是背景。如果没有,是什么让你觉得它在后台打开?


这是我用于测试的代码

 Dim accessApp As Access.Application 
设置accessApp = CreateObject(" Access.Application")
accessApp.Visible = False
accessApp.UserControl = True
accessApp.OpenCurrentDatabase(" C:\Documents\DataBaseForTesting.accdb")
accessApp.DoCmd.OpenReport" StronRMainT" ,acViewReport'StronRMainT是报告名称
accessApp.DoCmd.Maximize
accessApp.DoCmd.OpenForm(" Form1")
accessApp.Forms!Form1.SetFocus




此外,您能不能告诉我您的办公室版本,以便我可以尝试重现你的问题在同一个办公室版本中。


最好的问候,


I have a training program that uses PP in the front to open Access reports which are the tests and answers. This is stand alone with no server and no internet and the information needs to stay dynamic. At first I tried to use a link from the PowerPoint slide to to Access and then run a macro in access to open the report.

C:\Program Files\Microsoft Office\Office15\MSACCESS.EXE C:\sts\263X.mdb\x SKTL3P10A

This DID work until you closed the program and reopened it. When this is done the macro switch /x is changed to \x and thus it does not work. So far even the professionals at Microsft cant figure this one out so I tried another option. I wrote a macro in PowerPoint that would do essentially the same thing and this is it;

Dim accessApp
Set accessApp = CreateObject("Access.Application")
accessApp.Visible = True
accessApp.UserControl = True
accessApp.OpenCurrentDataBase ("C:\sts\263X.mdb")
accessApp.DoCmd.RunMacro "PHSL3P10"
DoCmd.Maximize
frmBackgroundForm.SetFocus

Again this works until I close and reopen the program. When I do this the macro does run BUT it opens in the background. If I go into Macros in PP and click "run" I get an error 424 Object required. I have read a few forums but none of the solutions seem to match my problem. I will admit I am not a programmer so some of it was over my head. Bottom line is it seems that PowerPoint and Accesss don't work well with each other but its all I have. I am very close to the finish line with this. Does anyone have a solution?

解决方案

Hi Blaster99,

->Again this works until I close and reopen the program.

What do you mean the program? Is it mean that you need to close access application before you run the macro? Could you tell more details of this?

->I get an error 424 Object required

You need open the form before you use SetFocus, so you need do like this

accessApp.DoCmd.OpenForm ("Form1")
accessApp.Forms!Form1.SetFocus


->When I do this the macro does run BUT it opens in the background.

Since I didn't have the code in "PHSL3P10", I have tried to reproduce your issue with a piece of similar code and the code works for me well. What do you mean background? Did you see the report opened in full screen? If you see, it is not background. If not, what makes you think it opens in the background?

Here is the code I used for testing

Dim accessApp As Access.Application
Set accessApp = CreateObject("Access.Application")
accessApp.Visible = False
accessApp.UserControl = True
accessApp.OpenCurrentDatabase ("C:\Documents\DataBaseForTesting.accdb")
accessApp.DoCmd.OpenReport "StronRMainT", acViewReport 'StronRMainT is the report name
accessApp.DoCmd.Maximize
accessApp.DoCmd.OpenForm ("Form1")
accessApp.Forms!Form1.SetFocus


Besides, could you please tell me your office version so I could try to reproduce your issue in the same office version.

Best Regards,


这篇关于使用PP宏以全屏方式打开Access报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆