how to get same item row from different item in one time in vb and ms access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • liji
    New Member
    • Apr 2014
    • 1

    #1

    how to get same item row from different item in one time in vb and ms access

    Code:
    If KeyAscii = 13 Then
    'Dim bal As Integer
     Dim rsdis As New ADODB.Recordset
    rsdis.Open " select  *  from tbls where empno='" & txtemp1.Text & "' and qtyc>0 order by matno,qtyc asc ", con, adOpenKeyset, adLockOptimistic
    'rsdis.Open " select time1,shift,empno,empname,distinctrow matno,matname,qtyi,qtyino,qtyiname,qtyc,remarks from tbls where empno='" & txtemp1.Text & "' and qtyc>0    ", con, adOpenKeyset, adLockPessimistic
    
    If rsdis.RecordCount > 0 Then
    
    With flxs
       .Rows = 2
       For i = 1 To rsdis.RecordCount
       .TextMatrix(i, 0) = rsdis("empname")
       .TextMatrix(i, 1) = rsdis("matno")
       .TextMatrix(i, 2) = rsdis("matname")
       .TextMatrix(i, 3) = rsdis("time1")
       .TextMatrix(i, 4) = rsdis("shift")
       .TextMatrix(i, 5) = rsdis("qtyi")
       .TextMatrix(i, 6) = rsdis("qtyino")
       .TextMatrix(i, 7) = rsdis("qtyiname")
       '   .TextMatrix(i, 8) = qtyconsumed
      .TextMatrix(i, 8) = rsdis("qtyc")
       .TextMatrix(i, 9) = rsdis("remarks")
       
       .Rows = .Rows + 1
       rsdis.MoveNext
       Next i
    End With
    
    'flxs.Enabled = True
    Else
    
    Label5 = "No Records Found"
    flxs.Clear
    
    flxs.FormatString = "         Name      | Material No |Material Name | Date & Time       | Shift |Qty Issued | Issuer No | Issuer Name | Qty Consumed "
    'flxpatsearch.TextMatrix(1, 0) = "Patient No"
     '   flxpatsearch.TextMatrix(2, 0) = "Name"
      '  flxpatsearch.TextMatrix(3, 0) = "Sex"
       ' flxpatsearch.TextMatrix(4, 0) = "Age"
        'flxpatsearch.TextMatrix(5, 0) = "Place"
        'flxpatsearch.TextMatrix(6, 0) = "Phone"
    
    
    'flxs.Visible = False
    
    End If
    
    
    KeyAscii = 0        ' Ignore this key.
             End If
    Last edited by Rabbit; Apr 22 '14, 03:33 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
Working...