访问表不会关闭 [英] Access Form Will Not Close

查看:77
本文介绍了访问表不会关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Access表单,该表单应该关闭其前身-

I have an Access form that is supposed to close its predecessor -

If CurrentProject.AllForms("fmFileCheck").IsLoaded Then
    DoCmd.Close acForm, "fmFileCheck", acSaveNo
    Else
    End If

IF语句可以正常工作(我已经插入了一个消息框进行测试),但是该窗体只是无法关闭.没有错误信息或其他任何内容,它只是坐在那里并束缚我,就像松鼠嘲弄猫一样.

The IF statement works fine (I have injected a message box to test) but the form simply doesn't close. No error message or anything, it just sits there and tants me, like a squirrel taunts a cat.

窗体在其前任的当前"事件上打开,并且上面的代码在当前"上执行-但是如果 open 的代码通过第二个窗体上的按钮调用,则第二个窗体然后它可以正常工作-所以我猜问题出在哪里?

The form opens on the "current" event of its predecessor and the code above executes on "current" - but if the code to open the second form is called via a button on the first then it works fine - so the issue I guess is somewhere in there?

推荐答案

我在单独使用表单(连续表单,显示公司信息,地址,联系信息等)时也遇到了类似的问题,尽管可以通过单击按钮打开另一种形式.该表格仅用于查看数据,无数据输入;因此我已将已启用数据"设置为False.不管使用哪种方式打开表单(从另一个表单或从左侧的导航栏),都无法使用按钮关闭表单(单击事件会驱动docmd.close acform,即me.name).

I had a similar problem with a form (continuous form, showed Company Info, address, contact info etc) its stand alone, though opened from a button click from another form. The form was for viewing data only, no data entry; so I had set Data Enabled to False. The Form would not close by using a Button (click event drives docmd.close acform, me.name), regardless of how the form was opened (from another form or from the navigation bar on the left).

我最近打开了它,决定将"Data Enabled False"设置为"True",并将"Data Lock"设置为True(从"false").完成该按钮后,表单将再次开始工作.不知道切换这两个设置是否与此有关;但是我对表单所做的唯一另一件事是调整选项卡顺序(关闭"按钮位于列表的底部,并保持在该位置).

I opened it recently decided to switch Data Enabled False to True and Data Lock to True (from false). After completing that the button the form began working again. Don't know if switching those two settings had anything to do with it or not; but the only other thing I had done to the form was adjust the tab order (the Close button was at the bottom of the list and remained there).

这篇关于访问表不会关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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