|
5#
楼主 |
发表于 2008-10-29 09:35:22
|
只看该作者
Dim db As DAO.Database
Dim reset As DAO.Recordset
Dim re As Integer
Dim gc As Date
gc = Me![造型数录入子窗体].Form![发生日期]
Set db = DBEngine.Workspaces(0).Databases(0)
SQL = "select * from 造型数历史表 where [发生日期] =# " & gc & "#"
Set reset = db.OpenRecordset(SQL, DB_OPEN_DYNASET)
reset.FindFirst " [发生日期] = # " & gc & "#"
If reset.NoMatch = True Then
//就这个循环为什么进不去啊,明明造型数历史表里有这个日期啊
re = MsgBox("该日造型数已经导入完毕,需要重新导入吗?", vbYesNo, "提示信息")
If re = 6 Then
reset.Close
db.Close
DoCmd.OpenQuery "删除造型数历史表已追加数据"
DoCmd.OpenQuery "每日造型数追加造型数历史表"
End If
Else
reset.Close
db.Close
DoCmd.OpenQuery "每日造型数追加造型数历史表"
End If
MsgBox "保存完毕!!!!!!"
End Sub |
|