|
Public Function gString(strWhere As String) As String
Dim rs As New ADODB.Recordset
Dim strSQL As String
Dim strTemp As String
Dim TF As Boolean
strSQL = "select ATP_sleeve,COMP_WC from Query2 where CO_NUMBER='" & strWhere & "' order by id desc"
With rs
.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockReadOnly
If .Fields("ATP_sleeve") < 0 Then
TF = True
Else
TF = False
End If
If TF = True Then
Do While Not .EOF
strTemp = strTemp & .Fields("COMP_WC") & ";"
.MoveNext
Loop
End If
.Close
End With
If Len(strTemp) <> 0 Then
gString = Left(strTemp, Len(strTemp) - 1)
Else
gString = ""
End If
Set rs = Nothing
End Function |
|