Dcount函数中的措辞问题

时间:2015-07-10 07:21:15

标签: access-vba dcount

点击(),我遇到问题或措辞如下:

Private Sub Cmd_Create_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim rs_conterparty As DAO.Recordset
Dim rsCount As Integer
Dim PE_nb As Integer
Dim BizNO As Field
Dim YearMonth As Field
Dim i, j, k, l, m, n As Integer

Set db = CurrentDb()
Set rs = db.OpenRecordset("TRD_ListofBiz")
Set BizNO = rs.Fields("BizNO")
Set YearMonth = rs.Fields("Year/Month of Delivery")

rs.MoveLast
rsCount = rs.RecordCount

Department = Me!Label_deal_status.Value
PE_nb = [Forms]![MAIN_PHYSICAL]![TRD_CONTERPARTY_PRI_VIEW]![TRD_Pricing-In]!Count

MsgBox (DCount("Year/Month of Delivery", "TRD_ListofBiz", "[Year/Month of Delivery]= '" & Me.Txt_entry & "'"))

我无法理解为什么DCount函数不起作用,尽管Msgbox很好地检索了“me.Txt_entry”

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

试试这个:

MsgBox (DCount("[Year/Month of Delivery]", "TRD_ListofBiz", "[Year/Month of Delivery]= '" & Me.Txt_entry & "'"))