|
某表有记录32767条,在使用逐条记录查询时报错,请教应该如何编写语句来解决此问题(含增加记录功能),谢谢!
部分代码如下:
。。。
If Rs.RecordCount > 0 Then
Rs.MoveFirst
For i = 1 To Rs.RecordCount
If (Rs("Group_No") = Me![GroupNo] And Rs("PartNumber") = Me![PartNumber] And Rs("Date_N") = Me![DTPicker0] And Rs("Description") = Me![Description]) Then
MsgBox "数据已存在!", vbCritical, "已存在"
Exit Sub
Else
Rs.MoveNext
End If
Next i '到达32767条时报错
End If
STemp = "INSERT INTO tblQualified "
STemp = STemp & "( Group_No,PartNumber,Description,IntheN,FirstN,SynthesisN,"
STemp = STemp & "Date_N)"
STemp = STemp & "VALUES ('" & Me![GroupNo] & "',"
STemp = STemp & "'" & Me![PartNumber] & "',"
STemp = STemp & "'" & Me![Description] & "',"
STemp = STemp & "'" & Me![IntheN] & "',"
STemp = STemp & "'" & Me![FirstN] & "',"
STemp = STemp & "'" & Me![SynthesisN] & "',"
STemp = STemp & "'" & Me![DTPicker0] & "')"
DoCmd.SetWarnings False
DoCmd.RunSQL STemp
DoCmd.SetWarnings True
MsgBox "已保存完成!", vbOKOnly, "保存完成"
。。。 |
|