如何处理组合的隐藏ID字段? [英] How to deal with hidden ID field of combo?
问题描述
<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屋!