Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.
'Class mudule Public Function Merged(ProCode As String) As String Dim Merge(1 To 2) As String Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset Dim sql As String Set rs = New ADODB.Recordset sql = "select Top 1 Tag_Name, Quantity from STOCK where PROCODE='" & ProCode & "'" rs.LockType = adLockOptimistic rs.CursorType = adOpenKeyset rs.Open sql, cn With rs If .BOF = True And _ .EOF = True Then Merge(1) = "" Merge(2) = (0) Else Merge(1) = !Tag_Name & "" Merge(2) = !Quantity End If .Close End With Set rs = Nothing End Function 'Form Public Sub Tag1() Dim s As Labeler Set s = New Labeler s.OPEN_CON "mydb", "" Dim j As SSCommand For Each j In cmd1 j.Caption = s.Merge(1)(j.Index) & vbNewLine & s.Merge(2)(j.Index) Next s.CLOSE_CON Set s = Nothing End Sub
Join the community of 500,000 technology professionals and ask your questions.