473,394 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

someone help me to solve this vba

hi am currently develop enrollment system just have a major problem in displaying student rankings see the image attachment.
Expand|Select|Wrap|Line Numbers
  1. With ListView1
  2. .ListItems.clear
  3. End With
  4. Set rs = New Recordset
  5. rs.Open "select * from revieweegrades ORDER BY GENAVE DESC ", con, 1, 2
  6. If rs.EOF Then
  7. Else
  8. With ListView1
  9. .ListItems.clear
  10. Do While Not rs.EOF
  11. .ListItems.Add , , (rs.Fields("batch_no").Value), 1, 1
  12. .ListItems(.ListItems.Count).SubItems(1) = (rs.Fields("reviewee_no").Value)
  13. .ListItems(.ListItems.Count).SubItems(2) = (rs.Fields("fullname").Value)
  14. .ListItems(.ListItems.Count).SubItems(3) = (rs.Fields("toa").Value)
  15. .ListItems(.ListItems.Count).SubItems(4) = (rs.Fields("blt").Value)
  16. .ListItems(.ListItems.Count).SubItems(5) = (rs.Fields("at2").Value)
  17. .ListItems(.ListItems.Count).SubItems(6) = (rs.Fields("ms").Value)
  18. .ListItems(.ListItems.Count).SubItems(7) = (rs.Fields("ap").Value)
  19. .ListItems(.ListItems.Count).SubItems(8) = (rs.Fields("pa1").Value)
  20. .ListItems(.ListItems.Count).SubItems(9) = (rs.Fields("pa2").Value)
  21. .ListItems(.ListItems.Count).SubItems(10) = (rs.Fields("genave").Value)
  22. Dim a, b As Integer
  23. Dim cs As ListItems
  24. b = 0
  25. For a = 1 To ListView1.ListItems.Count
  26.     If sm1 = ListView1.ListItems.Item(a).Text Then
  27.     End If
  28. With ListView1
  29.    .ListItems(.ListItems.Count).SubItems(11) = a
  30.      b = b + 1
  31.     End With
  32. Next a
  33. rs.MoveNext
  34. Loop
  35. End With
  36. End If
  37. Set rs = Nothing
  38.  
just want to make student who has a same genave will place same position...
subitems(11) will be the rankings
thanks
Attached Images
File Type: jpg 1.jpg (33.9 KB, 57 views)
Jul 1 '15 #1
0 1101

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

Similar topics

3
by: Alex | last post by:
Hi, I have a problem involving some design issue. I have two unrelated (that is, they do not derive from the same base) classes: ClassA ClassB Both have a quite similar interface, so they can...
3
by: Marek | last post by:
Hello gurus! I wrote a code in VBS, that will check, that current user is in one from three groups. But i don't know how asimilate it with asp.net. This page will be a bridge between 2 - main...
0
by: Alan Silver | last post by:
Hello, I am having a problem setting and resetting cookies. I'm sure I just doing something really stupid as this is such a basic issue, but I can find any answer. Please can someone help me? ...
8
by: vj | last post by:
Hi all, I want to solve the two equations u*tan(u)=w and u^2 + w^2=V^2, where V is a known constant, and u and w are the two unknowns to be determined. Please can someone suggest me how to...
0
jautrus
by: jautrus | last post by:
I would like to have div tag over list box, not list box over div tag. I have this problem on many pages usually when I use drop down menus. I try to solve this problem with z-index but it doesn't...
17
by: Michael Reichenbach | last post by:
Here is the example code. int main(int argc, char *argv) { string Result; WIN32_FIND_DATA daten; HANDLE h = FindFirstFile(TEXT("c://test"), &daten); system("PAUSE"); return EXIT_SUCCESS; }
3
by: nadzna | last post by:
i'm new in C++ world..i have a trouble in to solve the problem in array chapter... can someone help me how to solve this??? the QUESTION: Write a Program that calculate the 3 sum of matrices (4...
6
by: fido19 | last post by:
Once upon a time, there lived a chimpanzee called Luycha Bandor (aka Playboy Chimp). Luycha was unhappily married to Bunty Mona, a short but cute little lady chimp. Luycha was tall and handsome –...
1
by: brboga | last post by:
Hello, VBA gives an error on the indicated line. "tblparameters" is a database which exists. Option Compare Database Option Explicit Sub fill_parameters()
1
by: jinnejeevansai | last post by:
Can someone explain why is my code giving error "floating point exception" c I was trying to solve a problem but i was getting some error i debugged but cannot find can someone find it. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.