访问运行时错误-'-2147352567

时间:2018-07-13 07:00:17

标签: ms-access access-vba

“清除按钮”发生错误,其中两个字段的数据类型带有日期和时间

Private Sub cmdClear_Click()

    Me.SampleCode = ""
    Me.ReceivedDate = ""
    Me.SampleQuntity = ""
    Me.SampleReceivedTime = ""
    Me.SampleName = ""
    Me.BatchNo = ""
    Me.MRANo = ""
    Me.Division = ""
    Me.SubmittedBy = ""
    Me.ReceivedBy = ""
    Me.AssignedTo = ""

    ''focuse on SampleCode txtBox
    Me.SampleCode.SetFocus

End Sub

1 个答案:

答案 0 :(得分:1)

没有任何进一步的信息,可以是:

  • 您收到的日期不能接受任何空字符串。
    如果不能为Null,则将其设置为01-01-1900之类。

  • 任何数字字段都应设置为Null0

  • 可能是您遗忘了SampleQuntity。应该是SampleQuantity吗?