从文本框中编辑数据库中的数据,这些数据来自子表单 [英] Editing data from database in textbox which are taken from subform

查看:99
本文介绍了从文本框中编辑数据库中的数据,这些数据来自子表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的表单中,我有一个子表单,显示A,B,C。然后信息C显示在文本框中。用户应该有可能修改这些数据以修改数据库中的数据。


我能够在文本框中根据此子表单显示信息C.但它是不可编辑的,虽然启用的属性是肯定的,锁定的是否定的。


在我看来,编辑数据是不可能的,因为它不是直接来自数据库而是来自子表单,所以我做了特殊的查询,直接从数据库中获取数据但是我丢失了一个基于从子表单中选择适当记录的事件(只有onEnter和onExit事件)


是可以制作这样的东西吗?


感谢您的任何建议!


[ModEdit>> z {OP合并后的第2篇帖子如下}]


"我能够在基于此子表单的文本框中显示信息C.但它是不可编辑的,虽然启用的属性为是,并且锁定为否。


我收到一条消息控件无法编辑;它被绑定到表达式。

解决方案


t在我看来,编辑数据是不可能的因为它不是直接来自数据库,而是来自子表单,



更有可能的是,子表单的记录集不是来自可编辑的源,至少对于字段。


请通读:>发布之前(VBA或SQL)代码


然后发布您的SQL表格。


我怀疑他们正在使用文本框绑定到与子窗体相关的表达式并尝试编辑该绑定控件而不是源数据。


感谢您的重播。


因此,subfrom中的数据是可编辑的。


用于subPurpose的SQL代码(无VBA,用记录源编写):

展开 | 选择 | Wrap | 行号

In my form I have a subform, which displays A, B, C. Then information C is displayed in textbox. User should have a possibility to modify this data in order to modify data in database.

I am able to display information C in text box based on this subform. However it is uneditable, although property of enabled is yes and locked is no.

It seems to me, that it is impossible to edit data because it is taken not directly from database but from sub form, so I make special query which takes data directly from database however I lose an event which is based on selecting proper record from subform (there is only onEnter and onExit events)

Is it possible to make such things?

Thank you for any advices!

[ModEdit>>z{Merged post #2 by OP as follows}]

"I am able to display information C in text box based on this subform. However it is uneditable, although property of enabled is yes and locked is no."

I received a message "Control can''t be edited; it''s bound to the expression".

解决方案

t seems to me, that it is impossible to edit data because it is taken not directly from database but from sub form,

It is more likely that your recordset for the subform is not from an editable source, at least for that field.

Please read thru: > Before Posting (VBA or SQL) Code

Then post your SQL for the subform.


I suspect they are using a textbox bound to an expression related to the subform and attempting to edit that bound control rather than the source data.


Thank You for a replay.

So, data in subfrom are editable.

SQL Code (no VBA, written in Record Source) for subPurpose:

Expand|Select|Wrap|Line Numbers


这篇关于从文本框中编辑数据库中的数据,这些数据来自子表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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