Rankimg Students Marks

Joined
Apr 26, 2012
Messages
3
Reaction score
0
Hi guys, this is how far I have come with my problem. Anyone to help me fix it?

I want to create a program that can rank my students marks based on their scores. So I created a table in Access 2003 such as the one below.

Field Name Data Type
ID AutoNumber (Primary Key)
Name Text
CS Number
ES Number

The caption for the field CS is Class Score and that of ES is Exam Score.
Name of Table = tblMarks. The resulting table with some data is as follows:

[FONT=&quot]tblMarks[/FONT][FONT=&quot][/FONT]
[FONT=&quot]ID[/FONT]
[FONT=&quot]Name[/FONT]
[FONT=&quot]Class Score[/FONT]
[FONT=&quot]Exam Score[/FONT]
[FONT=&quot]1[/FONT]
[FONT=&quot]A[/FONT]
[FONT=&quot]23[/FONT]
[FONT=&quot]60[/FONT]
[FONT=&quot]2[/FONT]
[FONT=&quot]B[/FONT]
[FONT=&quot]26[/FONT]
[FONT=&quot]65[/FONT]
[FONT=&quot]3[/FONT]
[FONT=&quot]C[/FONT]
[FONT=&quot]22[/FONT]
[FONT=&quot]69[/FONT]
[FONT=&quot]4[/FONT]
[FONT=&quot]D[/FONT]
[FONT=&quot]25[/FONT]
[FONT=&quot]65[/FONT]
[FONT=&quot]5[/FONT]
[FONT=&quot]E[/FONT]
[FONT=&quot]27[/FONT]
[FONT=&quot]66[/FONT]

The table is bound to Visual Basic 6.0 interface which enables me to enter, edit or delete records. The VB Access connection was done with ADO Microsoft Jet 4.0 OLEDB Provider, using the connection string.

I then used the following SQL statement to create a query that generates the total marks as well as the positions.

SELECT tblMarks.ID, tblMarks.Name, [CS] AS [Class Score], [ES] AS [Exam Score], [CS]+[ES] AS Total, DCount("*","qryMarks","[Total]>" & [Total])+1 AS [Position]
FROM tblMarks
GROUP BY tblMarks.ID, tblMarks.Name, [CS], [ES], [CS]+[ES]
ORDER BY [CS]+[ES] DESC;


[FONT=&quot]qryMarks[/FONT][FONT=&quot][/FONT]
[FONT=&quot]ID[/FONT]
[FONT=&quot]Name[/FONT]
[FONT=&quot]Class Score[/FONT]
[FONT=&quot]Exam Score[/FONT]
[FONT=&quot]Total[/FONT]
[FONT=&quot]Position[/FONT]
[FONT=&quot]5[/FONT]
[FONT=&quot]E[/FONT]
[FONT=&quot]27[/FONT]
[FONT=&quot]66[/FONT]
[FONT=&quot]93[/FONT]
[FONT=&quot]1[/FONT]
[FONT=&quot]2[/FONT]
[FONT=&quot]B[/FONT]
[FONT=&quot]26[/FONT]
[FONT=&quot]65[/FONT]
[FONT=&quot]91[/FONT]
[FONT=&quot]2[/FONT]
[FONT=&quot]3[/FONT]
[FONT=&quot]C[/FONT]
[FONT=&quot]22[/FONT]
[FONT=&quot]69[/FONT]
[FONT=&quot]91[/FONT]
[FONT=&quot]2[/FONT]
[FONT=&quot]4[/FONT]
[FONT=&quot]D[/FONT]
[FONT=&quot]25[/FONT]
[FONT=&quot]65[/FONT]
[FONT=&quot]90[/FONT]
[FONT=&quot]4[/FONT]
[FONT=&quot]1[/FONT]
[FONT=&quot]A[/FONT]
[FONT=&quot]23[/FONT]
[FONT=&quot]60[/FONT]
[FONT=&quot]83[/FONT]
[FONT=&quot]5[/FONT]

Now, my problem is that, I cannot bind any text box to a field in the query table. The following error message pops up: Undefined function ‘DCount’ in expression.

Help is urgently needed. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top