错误类型不匹配错误消息

error type mismatch error message

我正在 Access 中开发一个应用程序,已经将近一周了,一遍又一遍地查看同一行代码,但我找不到错误(错误是 AT =定义行)我想要的是通过显示日期值的组合框过滤子表单数据表,子是这样的:

    Private Sub cbSelectDate_AfterUpdate()

    Dim AT As Date

    If Me.cbSelectDate = "" Then
    MsgBox ("First you need to fill the employee field")
    End If

    'On Error Resume Next

     AT = "select * from subform where ([AppointDate] = #" & Me.cbSelectDate & "#)"

     Me.subform.Form.RecordSource = AT

     Me.subform.Form.Requery
     End Sub

您正在将字符串传递给日期,将其更改为字符串