Private Sub Form_Load()
Dim i, j As Long
Dim a, b, c As String
j = Me.RecordsetClone.RecordCount
Me.Recordset.MoveFirst
Me.SendNo = "OQC" & Format(Me.SendDate, "yymm") & "001"
For i = 1 To j
'要望书回复情报
If IsNull(Me.FactDate) And Me.ReplyDate < Date Then
Me.OnTime = "NoAnswer"
Else
Me.OnTime = ""
End If
'发行NO情报
If Me.SendNo = "" Then
If a = Me.LotNo And b = Me.MaterialNo Then
Me.SendNo = c
Else
Me.SendNo = "OQC" & Format(Me.SendDate, "yymm") & Format(CLng(DMax("mid(SendNo,8,3)", "IQC_Send") + 1), "000")
End If
a = Me.LotNo: b = Me.MaterialNo: c = Me.SendNo
Else
a = Me.LotNo: b = Me.MaterialNo: c = Me.SendNo
End If
Me.Recordset.MoveNext
Next
End Sub
Private Sub Form_Load()
On Error GoTo aa
On Error Resume Next
Dim i, j As Long
Dim b, c, d, e As String
Dim f As Integer
j = Me.RecordsetClone.RecordCount
Me.Recordset.MoveFirst
Me.SendNo = "OQC" & Format(Me.SendDate, "yymm") & "001"
f = 1
For i = 1 To j
If IsNull(Me.SendNo) Then
If Format(Me.SendDate, "yymm") = e Then
If b = Me.LotNo And c = Me.MaterialNo Then
Me.SendNo = d
Else
Me.SendNo = "OQC" & Format(Me.SendDate, "yymm") & Format(f + 1, "000")
f = f + 1
End If
b = Me.LotNo: c = Me.MaterialNo: d = Me.SendNo: e = Format(Me.SendDate, "yymm")
Else
Me.SendNo = "OQC" & Format(Me.SendDate, "yymm") & "001"
f = 1
End If
b = Me.LotNo: c = Me.MaterialNo: d = Me.SendNo: e = Format(Me.SendDate, "yymm")
Else
b = Me.LotNo: c = Me.MaterialNo: d = Me.SendNo: e = Format(Me.SendDate, "yymm")
End If
Me.Recordset.MoveNext
Next