7,789
社区成员
发帖
与我相关
我的任务
分享 If TraceabilityFlg = 1 Then
TMsgTxt = TraceabilityRCheck()
If Len(TMsgTxt) <> 0 Then
MsgBox grdMain.Columns("CD").Value & "号未设定、" _
& vbCrLf & "请设定", vbInformation + vbOKOnly + vbDefaultButton1
Exit Sub
End If
TMsgTxt = TraceabilityZCheck()
If Len(TMsgTxt) <> 0 Then
MsgBox grdMain.Columns("CD").Value & "号未设定、" _
& vbCrLf & "请设定", vbInformation + vbOKOnly + vbDefaultButton1
Exit Sub
End If
End IfPrivate Function TraceabilityZCheck() As String
Dim m_rs As ADODB.Recordset
Dim ChkStr As String
On Error GoTo Err_Handler
TraceabilityZCheck = ""
ChkStr = ""
Set m_rs = m_rsDirect.Clone(adLockReadOnly)
Do Until m_rs.EOF = True
If (m_rs.Fields("数量").Value <> "") _
And (IsNull(m_rs.Fields("重量").Value) Or m_rs.Fields("重量").Value = "") _
Then
ChkStr = ChkStr + CStr(m_rs.Fields("CD"))
Exit Do
End If
m_rs.MoveNext
Loop
Call ReleaseRecordset(m_rs)
TraceabilityZCheck = ChkStr
Exit Function
End Function 'TraceabilityZCheck
