将2个字段连接到同一个表中的另一个字段

将2个字段连接到同一个表中的另一个字段

本文介绍了将2个字段连接到同一个表中的另一个字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将2个字段组合(连接)到同一个表中的另一个字段中。在查询中运行良好,我理解如何在表单上执行此操作,但如何将返回值(值)存储回表中?


这两个值的组合决定了一个独特的字符串.... 事件:[castype]&""& [casnumber]


此结果我用于将我的主表单链接到我的子表单,也将用于runnig报表。


另外因为上面的表达式事件:[castype]&" ;& [casenumber] 放在查询的Field行中,当我添加要存储子表单信息的表时,似乎从主要表单中锁定了其他数据正在输入。


当我使用相同的查询并且我删除时来自字段行的连接表达式并且只使用casenumber作为我的链接参考子表单一切都很好用!


不幸的是..我必须找到一种能够将两者结合起来的方法CaseType和CaseNumber字段。只有这两个数字的组合才能使其唯一。

I am attempting to combine (concate) 2 fields into another field in the same table. Works great in a query and I understand how to do it on a form, but how do I store the return (value) back into my table?

The combination of these two values determine a unique string.... Event:[castype]&""&[casnumber]

This result I use for linking my Main Form to my Subform and will also be used for runnig reports.

Also because the above expression Event:[castype]&""&[casenumber] is placed in the Field line of the query, when I add the table where the information of the subform is to be stored it seems to lock the main form from further data being entered.

When I use the same query and I "remove" the concate expression from the field line and use only the casenumber as my linking reference the subform everything works great!

Unfortunately.. I have to figure out a way to be able to combine both the CaseType and CaseNumber fields. Only the combination of these two numbers can make it unique.

推荐答案

展开 | 选择 | Wrap | 行号


  1. 解锁绑定的[Event]控件。
  2. 将绑定的[Event]控件的值设置为您想要的值( Me.CASType& Me.CASNumber )。
  3. 重新锁定绑定的[Event]控件。



这样新的[ Event]字段将始终反映其他两个字段的串联,但用空格分隔。


This way the new [Event] field will always reflect the concatenation of the two other fields but separated by a space.


  1. 不在[code]标签中发布你的代码是你需要做的。
  2. 包括一个毫无意义的空字符串没有任何意义。



我已经为您解决了第一个问题。请记住以备参考。这样的事情是我们坚持使用CODE标签的主要原因,因为代码从未被设计为以比例字体显示,例如在标准网页上。


NB。也可能需要ADezii的代码。他使用的名字与你问题中的一个相匹配,所以如果它不正确你只能为此负责。无论如何,这个含义都很清楚。


请记住,如果需要更新现有数据(根据你的问题,我猜这是在这种情况下) ,只有在您首先修复设计的基础问题后才会有任何用处。否则,您将处于永远不得不修复数据的位置,这不是一个好主意。


I''ve fixed the first issue for you. Please remember for future reference. Things like that are the main reason we insist on CODE tags as code was never designed to be displayed in a proportional font such as on a standard web page.

NB. ADezii''s code may also be required. The name he used matches one of the ones in your question, so if it''s not correct you only have the question to blame for that. The meaning is quite clear regardless.

Bear in mind, that updating existing data, if it is required (which, from your question, I''m guessing it is in this case), is only any use after you fix the underlying issue with the design in the first place. Otherwise you will be in a position where you are forever having to fix the data, which is not a good idea.


这篇关于将2个字段连接到同一个表中的另一个字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 18:43