473,324 Members | 2,239 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,324 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 1097

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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.