hahahan 发表于 2008-7-9 23:22

利用combo box索引查询Access,超过5次就报错!5次以内正常……

求助达人!
==============================================================
Private Sub cboID_Change()     'combo box更改事件
    rs.Find " Custom_ID " & " = " & cboID.Text  ’custom_ID为数值型,cboID初始化便赋多个custom_ID值
    Call rsTotxt
End Sub
-------------------------------------

Private Sub rsTotxt()     ’将rs.fields(*) 写如 textbox

    txtParent = rs.Fields(5)      'Access中字段为 文本 型    // 错误出现在此行
    txtArea = rs.Fields(4)        'Access中字段为 数值 型
    txtPerimeter = rs.Fields(3)   'Access中字段为 数值 型
    txtSlope = rs.Fields(6)       'Access中字段为 数值 型
    txtRough = rs.Fields(7)       'Access中字段为 数值 型

End Sub
=================================================================

运行至5次以上时,便报错:
Run-time error '-2147352571(80020005)':
Could not set the Value property. 类型不匹配


我的问题,如果真的是类型不匹配,为什么前几次变动combo box 查询时不报错??
我一开始猜想会不会是变量空间不够的问题,试了每次赋值前清空 txtbox,但还是不行。

请教各位高手!!  不胜感激!

taihongbo 发表于 2008-7-10 21:47

不知说的对不?

最好判断以下是否没有找到.
到低有NULL值

页: [1]

编程论坛