Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
AutoNumber field in a query
Amir Mahamat Abakar 
   
2 years ago
Hello guys I'm making school database in access and I sort students in a query by values descending.
I want access to make a number field automaticaly for each student in the sama query.
It's like the one on top of the list will automaticaly have number one and the seconde number two and so on.
please help me
Alex Hedley  @Reply  
           
2 years ago
Amir Mahamat Abakar OP  @Reply  
   
2 years ago
This is working only for Integer numbers (ID number). But when I use numbers with coma (the exam scores for  students) It's showing "#error". Please I'm still in need of help.
Sami Shamma  @Reply  
             
2 years ago
How did you define your score field? Use number format "Double".
Amir Mahamat Abakar OP  @Reply  
   
2 years ago
The scores field is a calculated field in a query.
Sami Shamma  @Reply  
             
2 years ago
Calculated based on what fields?
Are those fields defined correctly?
What is your calculation?
Amir Mahamat Abakar OP  @Reply  
   
2 years ago

Adam Schwanz  @Reply  
           
2 years ago
DCount

Something like
DCOUNT("*","StudentT","Score<=" & Score)
Adam Schwanz  @Reply  
           
2 years ago
Also that assumes it's a number field just with formatting to add the commas, if they are real commas and it's a text field you would have to convert it to a number first.
Amir Mahamat Abakar OP  @Reply  
   
2 years ago
All the fields I used to calculate the "Score" field are formated "real Double". So the  "Score" field is real double too. The Dcount function consider the coma as a syntaxe error.
So I tried This in the query:
1. I created a field that convert the score field from "real double" to "Integer" using this sintaxe "S:Fix(Score*1000000)"
the "1 000 000" is just a factor that allows me to avoid similar numbers ( 9.45536 and 9.89992 are same for "Fix" function)
2. I used the DCOUNT function with the "S" field.
Now it's working!
Let me know if there is a better way.
You have just saved my life
THANK YOU

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/7/2026 8:19:59 PM. PLT: 1s