如何处理组合的隐藏ID字段? [英] How to deal with hidden ID field of combo?

查看:86
本文介绍了如何处理组合的隐藏ID字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<br />
Private Sub CmbItem_LostFocus()<br />
If CmbItem = Empty Then Exit Sub<br />
       CmbCode.ListIndex = CmbItem.ListIndex<br />
       CmbUnit.ListIndex = CmbItem.ListIndex<br />
End Sub<br />





我正在使用此代码在(项目)字段的选择上设置(Id)和(单位)字段。

[1]我不能使用.itemdata因为它给错误OVERFLOW...(实际上项目字段加载了约26000条记录,必须在组合数据中显示)



[2]我不能把(援助)在每个(项目)的文本中给出错误SYNTAX ERROR......(许多项目都像(例如STEEL CUPBOARD 5')所以



I'm using this code to set (Id) and (Unit) fields on selection of (Item) field.
[1] I can't use .itemdata coz it gives error "OVERFLOW"...(actually item field is loaded about 26000 records n have to show in combo datz y)

[2] I can't put(aid)in the text for each (item) it gives error "SYNTAX ERROR"...(many of items are like(ex. STEEL CUPBOARD 5') so

sql="SELECT *FROM [ASSET] WHERE Item = "'CmbItem.text'" <br />

不工作

所以任何人都有其他方式这样做我的意思是我想添加(Id)而不显示它...



请帮助我...

not working
so anybody is having any other way to do so I mean I want to add (Id) without displaying it...

Please help me...

推荐答案

不确定wh在你试图做但是....

not sure what you're trying to do but....
sql="SELECT *FROM [ASSET] WHERE Item = "'CmbItem.text'" 



应该是


should be

sql="SELECT * FROM [ASSET] WHERE Item = '" & CmbItem.text & "'" 





注意单引号和双引号,加上&缺少

不确定这是否是拼写错误或sql语句的问题.....



Note the single quote and double quotes, plus the & is missing
Not sure if that was a typo or the problem with the sql statement.....


这篇关于如何处理组合的隐藏ID字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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