北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |
问题出在日期:
If DCount("*", "RbInDay", "LOTid = " & rst!LotID & " AND Indate= #" & Format(rst!InDate, "DD/MM/YYYY") & "#") > 0 Then
如果只是以下没问题的.加上日期就没找到了,表里有相同的都是=0,请教如何解决,感谢:
If DCount("*", "RbInDay", "LOTid = " & rst!LotID & " ") > 0 Then
---------------------
Private Sub BTN_OK_Click()
Dim rst As Recordset
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
Dim rst1 As Recordset
Set rst1 = New ADODB.Recordset
rst1.ActiveConnection = CurrentProject.Connection
rst.Open "RbInTemp", , adOpenKeyset, adLockOptimistic
rst1.Open "RbInDay", , adOpenKeyset, adLockOptimistic
If rst.RecordCount = 0 Then Exit Sub
rst.MoveFirst
Do Until rst.EOF
If DCount("*", "RbInDay", "LOTid = " & rst!LotID & " AND Indate= #" & Format(rst!InDate, "DD/MM/YYYY") & "#") > 0 Then
‘’------If DCount("*", "RbInTemp", "InDate = #" & rst1!InDate & "#") > 0 Then
'rst1!Bundle = rst!Bundle + rst1!Bundle
'rst1!psc = rst!Pcs + rst1!Pcs
'rst1!NetW = rst!NetW + rst1!NetW
'rst1.Update
Else
Rst1.Add New
'rst1!Bundle = rst!Bundle + rst1!Bundle
'rst1!psc = rst!Pcs + rst1!Pcs
'rst1!NetW = rst!NetW + rst1!NetW
'rst1.Update
End If
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
rst1.Close
Set rst1 = Nothing
Me.frmRbInTempSub.Requery
End Sub