如何在添加记录中打开表格 [英] How to open Form in Add record

查看:50
本文介绍了如何在添加记录中打开表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种将记录输入到表中的表格.我希望它以空添加(新建)打开,而不是显示表的第一条记录.由导航表单使用,该导航表单通过按钮打开输入表单.

I have a form to input records to a table. I would like it to open on an empty add (New) instead of displaying the first record of the table. To be used by a Navigation Form which opens the input form from a button.

推荐答案

您可以将acFormAdd(值= 0)用作OpenForm的可选DataMode参数. Access的帮助将acFormAdd描述为用户可以添加新记录,但不能编辑现有记录." 实际上,这不仅会阻止现有记录的编辑,甚至不会显示在其中.带有该选项的表格.

You can use acFormAdd (value = 0) as the optional DataMode argument to OpenForm. Access' help describes acFormAdd as "The user can add new records but can't edit existing records." And actually, not only does that prevent editing of existing records, they are not even displayed in the form with that option.

DoCmd.OpenForm "frmaw_save",,,,acFormAdd

如果要始终以这种方式使用表单,可以将其数据输入"属性设置为Yes(在表单属性表的数据"选项卡上).

If you want to always use the form that way, you can set its Data Entry property to Yes (on the Data tab of the form's property sheet).

这篇关于如何在添加记录中打开表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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