0

on click(), I am having problem or wording in the following:

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 & "'"))

I cannot understand why the DCount function does not work, although the a Msgbox well retrieve the "me.Txt_entry"

Thanks for your help.

Erik A
  • 31,639
  • 12
  • 42
  • 67

1 Answers1

1

Try this:

MsgBox (DCount("[Year/Month of Delivery]", "TRD_ListofBiz", "[Year/Month of Delivery]= '" & Me.Txt_entry & "'"))
phoog
  • 42,068
  • 6
  • 79
  • 117