首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >DLOOKUP溢出6

DLOOKUP溢出6
EN

Stack Overflow用户
提问于 2015-12-17 01:03:23
回答 1查看 45关注 0票数 0

我使用两个未绑定的textboxes作为输入,使用第三个textbox作为输出。我的表中包含了Dlookup应用到的大约19K的重新编码。但是,如果输入包含5K以上记录的值,则会出现溢出6错误。有什么帮助吗?这是密码..。

代码语言:javascript
复制
Private Sub Command4_Click()
On Error GoTo Message
Dim r As Integer, s As String
Dim u As String
r = Text0.Value
s = Text2.Value
u = DLookup("ActionBy", "RAW", "[requestid]=" & r & " AND [Type]='" & s & "'")
Me.Text7 = u
Exit Sub
Message:
MsgBox Err.Description & " " & Err.Number
MsgBox "Make sure you've entered the correct Values", , "Static Error"
End Sub
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-12-17 08:10:09

您的代码可能由于许多原因而失败。试试这个更健壮的版本:

代码语言:javascript
复制
Private Sub Command4_Click()

    ' Uncomment this line when code is verified:
    ' On Error GoTo Message

    Dim r As Long
    Dim s As String
    Dim u As Variant

    r = Nz(Text0.Value, 0)
    s = Nz(Text2.Value)
    u = DLookup("ActionBy", "RAW", "[requestid]=" & r & " AND [Type]='" & s & "'")
    Me.Text7.Value = u
    Exit Sub

Message:
    MsgBox Err.Description & " " & Err.Number
    MsgBox "Make sure you've entered the correct values.", , "Static Error"

End Sub

另外,将Command4重命名为有意义的东西。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34324979

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档