也可:
Idx = e.DataTable.Compute("Count(日期)","日期 = #" & e.NewValue & "#")
e.DataRow("编号") = bh & "-" & Format(idx,"000") '可能Count 效率低于Max