VB 设置循环,以及弹出messageBox

Do While Not rs.EOF

If (Trim(rs.Fields("Result") <> "OK") And REGION = "JET") Then

strError = Trim(rs.Fields("SN")) & "," & Trim(rs.Fields("Description")) & "\n"

end if

rs.MoveNext

Loop

If strError <> "" And REGION = "JET" Then

'frmScancer.LabMsg.Caption = "This Pallet is wrong! The message is " & strError 'Trim(rs.Fields("PartNumber"))

intRetval = sndPlaySound(WavePath + "SernumError.wav", SND_ASYNC)

MsgBox "Warning: This Pallet is wrong! The message is " & strError, vbDefaultButton1, "Warning!"

rs.Close

Set rs = Nothing

Exit Function

End If

MsgBox "Warning: There are no files to move!", vbDefaultButton1, "Warning!"