我使用两个未绑定的textboxes作为输入,使用第三个textbox作为输出。我的表中包含了Dlookup应用到的大约19K的重新编码。但是,如果输入包含5K以上记录的值,则会出现溢出6错误。有什么帮助吗?这是密码..。
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发布于 2015-12-17 08:10:09
您的代码可能由于许多原因而失败。试试这个更健壮的版本:
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重命名为有意义的东西。
https://stackoverflow.com/questions/34324979
复制相似问题