当我在表单上创建清除按钮时,它正在清除数据库,而不仅仅是表单 [英] When i created my clear button on my form, it is clearing the db, not just the form

查看:45
本文介绍了当我在表单上创建清除按钮时,它正在清除数据库,而不仅仅是表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

展开 | 选择 | Wrap | 行号

推荐答案

从您发布的代码我猜你想要显示一个空记录在表格上。我还猜你正在处理的形式是一种约束形式。 IE浏览器。它有一个记录源,窗体上的控件有控件来源。


你需要理解的是,绑定表单就像一个窗口,表单背后的数据,记录集表单必然会被绑定。如果它将控制值设置为Null时指向有效记录,那么它将被传递到记录本身的字段。


您可能正在寻找什么是将表单(窗口)移动到单独的记录上的想法。以绑定形式移动记录时,您会在每个记录中看到不同的数据。要清除表单,您真正需要做的是转到新记录。这是在允许添加的所有记录集中找到的特殊记录。


这听起来像是你要追求的吗?
From your posted code I would guess that you''re looking to show an empty record on the form. I also guess that the form you''re dealing with is a bound form. IE. It has a Record Source and the controls on the form have Control Sources.

What you need to understand is that bound forms are like a window onto the data behind the form, of the recordset that the form is bound to. If it''s pointing to a valid record when you set the control values to Null then that will be passed on to the fields of the record itself.

What you are probably looking for is the idea of moving the form (window) on to a separate record. When you move records in a bound form you see the different data in each of those records. To clear the form what you really need to do is to move to the New record. This is a special record found in all recordsets that allow additions.

Does this sound like it''s what you''re after?





您是否尝试取消对表单的所有更改而不保存?


如果是这样,那么也许是Me.Undo(? )或类似的,因为转移到新记录将保存任何改动。


只是一个想法。


MTB
Hi

Are you trying to cancel all alterations to the form without saving then?

If so, then perhaps Me.Undo (?) or similar, as moving to a new record will save any alterations.

Just a thought.


MTB


我正在尝试使用撤消,但它无法正常工作。

I am trying to use the undo but it is not working.

展开 | 选择 < span class =codeDivider> | Wrap | 行号


这篇关于当我在表单上创建清除按钮时,它正在清除数据库,而不仅仅是表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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