By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,805 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,805 IT Pros & Developers. It's quick & easy.

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

P: 1
Expand|Select|Wrap|Line Numbers
  1. If KeyAscii = 13 Then
  2. 'Dim bal As Integer
  3.  Dim rsdis As New ADODB.Recordset
  4. rsdis.Open " select  *  from tbls where empno='" & txtemp1.Text & "' and qtyc>0 order by matno,qtyc asc ", con, adOpenKeyset, adLockOptimistic
  5. '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
  6.  
  7. If rsdis.RecordCount > 0 Then
  8.  
  9. With flxs
  10.    .Rows = 2
  11.    For i = 1 To rsdis.RecordCount
  12.    .TextMatrix(i, 0) = rsdis("empname")
  13.    .TextMatrix(i, 1) = rsdis("matno")
  14.    .TextMatrix(i, 2) = rsdis("matname")
  15.    .TextMatrix(i, 3) = rsdis("time1")
  16.    .TextMatrix(i, 4) = rsdis("shift")
  17.    .TextMatrix(i, 5) = rsdis("qtyi")
  18.    .TextMatrix(i, 6) = rsdis("qtyino")
  19.    .TextMatrix(i, 7) = rsdis("qtyiname")
  20.    '   .TextMatrix(i, 8) = qtyconsumed
  21.   .TextMatrix(i, 8) = rsdis("qtyc")
  22.    .TextMatrix(i, 9) = rsdis("remarks")
  23.  
  24.    .Rows = .Rows + 1
  25.    rsdis.MoveNext
  26.    Next i
  27. End With
  28.  
  29. 'flxs.Enabled = True
  30. Else
  31.  
  32. Label5 = "No Records Found"
  33. flxs.Clear
  34.  
  35. flxs.FormatString = "         Name      | Material No |Material Name | Date & Time       | Shift |Qty Issued | Issuer No | Issuer Name | Qty Consumed "
  36. 'flxpatsearch.TextMatrix(1, 0) = "Patient No"
  37.  '   flxpatsearch.TextMatrix(2, 0) = "Name"
  38.   '  flxpatsearch.TextMatrix(3, 0) = "Sex"
  39.    ' flxpatsearch.TextMatrix(4, 0) = "Age"
  40.     'flxpatsearch.TextMatrix(5, 0) = "Place"
  41.     'flxpatsearch.TextMatrix(6, 0) = "Phone"
  42.  
  43.  
  44. 'flxs.Visible = False
  45.  
  46. End If
  47.  
  48.  
  49. KeyAscii = 0        ' Ignore this key.
  50.          End If
Apr 22 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.