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="]A[/FONT]
[FONT="]B[/FONT]
[FONT="]C[/FONT]
[FONT="]D[/FONT]
[FONT="]E[/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="]E[/FONT]
[FONT="]B[/FONT]
[FONT="]C[/FONT]
[FONT="]D[/FONT]
[FONT="]A[/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.
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="]tblMarks[/FONT][FONT="][/FONT]
[FONT="]ID[/FONT]
[FONT="]Name[/FONT]
[FONT="]Class Score[/FONT]
[FONT="]Exam Score[/FONT]
[FONT="]1[/FONT]
[FONT="]23[/FONT]
[FONT="]60[/FONT]
[FONT="]2[/FONT]
[FONT="]26[/FONT]
[FONT="]65[/FONT]
[FONT="]3[/FONT]
[FONT="]22[/FONT]
[FONT="]69[/FONT]
[FONT="]4[/FONT]
[FONT="]25[/FONT]
[FONT="]65[/FONT]
[FONT="]5[/FONT]
[FONT="]27[/FONT]
[FONT="]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="]qryMarks[/FONT][FONT="][/FONT]
[FONT="]ID[/FONT]
[FONT="]Name[/FONT]
[FONT="]Class Score[/FONT]
[FONT="]Exam Score[/FONT]
[FONT="]Total[/FONT]
[FONT="]Position[/FONT]
[FONT="]5[/FONT]
[FONT="]27[/FONT]
[FONT="]66[/FONT]
[FONT="]93[/FONT]
[FONT="]1[/FONT]
[FONT="]2[/FONT]
[FONT="]26[/FONT]
[FONT="]65[/FONT]
[FONT="]91[/FONT]
[FONT="]2[/FONT]
[FONT="]3[/FONT]
[FONT="]22[/FONT]
[FONT="]69[/FONT]
[FONT="]91[/FONT]
[FONT="]2[/FONT]
[FONT="]4[/FONT]
[FONT="]25[/FONT]
[FONT="]65[/FONT]
[FONT="]90[/FONT]
[FONT="]4[/FONT]
[FONT="]1[/FONT]
[FONT="]23[/FONT]
[FONT="]60[/FONT]
[FONT="]83[/FONT]
[FONT="]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.