从组合框填充备注字段 [英] Populating Memo Field from Combo Box

查看:64
本文介绍了从组合框填充备注字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我尝试了几种不同的方法来实现这一目标,但没有运气。我将在本文末尾发布最新尝试的代码。


我在一家土地测量公司工作。该数据库用于跟踪调查订单。

其中一个字段用于输入土地所在的细分。新订单表格中的该字段称为SUB_NAME。在该表单上,它是一个组合框,使用一个名为subd的单独表。在该表中只有两个字段:subd_name和(不要与表单中的SUB_NAME和warn_message混淆。) warn_message的目的是warn_message。是因为某些细分部门对进行调查的现场工作人员有特殊说明或指示,与该特定细分有关(例如注意:只能通过房屋进入后院,注意:没有任何一个地段这个细分是等等。


在我的新订单表格中,我有一个备忘录字段,用于特殊说明或评论,称为COMM_1。这个备忘录字段有多种用途,包括现场工作人员的特殊说明。


我要做的是如下:

当细分时被选中或输入到SUB_NAME中字段,我希望代码查看是否存在针对sub的细分的警告消息。表。如果有,我希望它弹出一个显示该警告消息的消息框。我希望输入记录的人可以选择(通过是/否消息框)在COMM_1中自动输入该警告消息。备忘录字段。现在,该备忘录字段中可能已经存在某些内容,我不希望新的警告消息替换那里已存在的内容。我只是想在现有文本之前插入它。


到目前为止,我的一些尝试在消息框中正常工作,但不会将警告消息文本插入备注字段。我的最新尝试既未在消息框中显示警告消息,也未将其插入备忘录字段。我的组合框有两列:一列用于subd_name和第二个是warn_message。第二列是隐藏的(宽度= 0英寸)


我做错了什么?

展开 | 选择 | Wrap | 行号

解决方案

尝试使用更正(更正的代码行如此标注)。我不确定这一点,但您可能还需要将组合框中[warn_message]列(绑定)的宽度更改为.1(点十分之一英寸),这足以使其隐藏,但仍然可以它的值可以传递给文本框。我似乎记得,如果你打算复制并传递列的值,列宽不能为零,

展开 | 选择 | Wrap | 行号

这些更正对我有意义,但似乎没有任何改变。


1。您是否尝试将组合框的绑定列的宽度从零更改为.1,如建议的那样?

2.您的测试数据是否有警告消息?

3你需要放置控制中断并在断点处查看变量的值。哪些变量不显示应该有值的值?


Hi all,

I have tried a few different methods to accomplish this, but with no luck. I will post the code for the latest attempt at the end of this post.

I work at a land surveying company. This database is for tracking survey orders.
One of the fields is for entering the Subdivision that the parcel of land is in. That field on the New Orders entry form is called "SUB_NAME". On that form it is a combo box that uses a seperate table called "subd". In that table are two fields only: "subd_name" (not to be confused with "SUB_NAME" in the form) and "warn_message". The purpose for "warn_message" is because some subdivisions have special notes or instructions for the field crew conducting the survey, relevant to that particular subdivision (such as "Note: The only access to back yards is through the houses", "Note: None of the lots in this subdivision are staked", etc.)

On my New Orders form I have a Memo field for special instructions or comments called "COMM_1". This memo field serves a variety of purposes, including special instructions for the field crew.

What I am trying to do is as follows:
When a subdivision is selected or typed into the "SUB_NAME" field, I want the code to look to see if a warning message exists for that subdivision on the "subd" table. If one does, I want it to pop up a message box displaying that warning message. I want the person entering the records to have the option (via the yes/no message box) to automatically enter that warning message in the the "COMM_1" memo field. Now, there may already be something in that memo field, and I don''t want the new warning message to replace whatever already exists there. I just want it inserted before the existing text.

So far, some of my various attempts work fine for the message box, but will not insert the warning message text into the memo field. My latest attempt neither displays the warning message in the message box, nor inserts it into the memo field. My combo box has two columns: one for "subd_name" and the second for "warn_message". The second column is hidden (width = 0 in)

What am I doing wrong?

Expand|Select|Wrap|Line Numbers

解决方案

Try this with the corrections (corrected code lines are noted as such) . I am not certain about this, but you may also have to change the width of the [warn_message] column (bound) in the combobox to .1 (point one tenth of an inch) which will be enough to keep it hidden, yet make its value accessible for passing to the textbox. I seem to remember that the column width can''t be zero if you intend to copy and pass the value of the column,

Expand|Select|Wrap|Line Numbers


those corrections made sense to me, however nothing seems to have changed.


1. Did you try changing the width of the bound column of the combobox from zero to .1, as suggested?
2. Did your test data have a warning message?
3. You need to place control breaks and look at the values of your variables at the breakpoints. Which variables do not show any values where there should be values?


这篇关于从组合框填充备注字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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