当我从组合框或点击事件中失去焦点时,我想存储公司ID [英] I Want to Store Company Id When I Have Lost Focus From the combo box or click event

查看:52
本文介绍了当我从组合框或点击事件中失去焦点时,我想存储公司ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过游标显示我公司的名称

I Was Display My Company's Name through cursor

我的查询SQL查询是表格初始化时Form.Init

My Query SQL Query is When Form Was Initialized Form.Init

选择名称从untmst进入光标untmstname(这里Untmst是表名和非名称是光标名)

Select name From untmst Into Cursor untmstname(Here Untmst Is Table Name ANd untmstname is Cursor Name)

选择  untmstname

select untmstname

thisform.combobox1.value = name 

thisform.combobox1.value = name 

这里我希望将公司ID存入公共变量

Here I want store Company Id Into Public variable

我的变量是不可用的

我使用代码进入Combobox LostFocus活动 

And I Use Code Into Combobox LostFocus Event 

找到  (untmst.companyid)= thisform.combobox1.value 

Locate For  (untmst.companyid) = thisform.combobox1.value 

store (untmst.companyid)To UntId

store (untmst.companyid) To UntId

但公司ID不存储  ;我犯错的地方 

But The Company Id Is Not Store  Where I Do Mistake 




 

推荐答案

以这种方式使用组合框:

Use a combobox this way:

选择第一列后rowsource游标是可见的,但您可以使用bindcolumn将另一列指定为值以存储到controlsource字段中。

After selection the first column of the rowsource cursor is visible, but you can use bindcolumn to specify another column as value to store into the controlsource field.

所以你
选择名称,
companyid 
untmst进入光标untmstname

然后se t up boundcolumn = 2绑定到第二个字段中的id和列宽100,0以使第二个列不可见并显示名称。

最后你没有将companyid存储到UntId,你将controlsource设置为UntId或更好的destinationalias.Unitid,你不绑定到变量,
绑定到表,视图或游标。

再见,奥拉夫。


这篇关于当我从组合框或点击事件中失去焦点时,我想存储公司ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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