Hi, I am working on my project and your HELP guys is really appreciated. I have a STUDENT NUMBER textbox, and what I want is when the form is open, IT WILL AUTOMATICALLY ASSIGN student number so that the registrar will not bother anymore to encode the student number...Is this possible?...Thanks
NewCoder_31
0
Newbie Poster
Recommended Answers
Jump to PostI'll assume that you are using a database. You can select the current maximum student number by
SELECT MAX(StudentNo)
Therefore the next available number would be
SELECT MAX(StudentNo)+1 AS NextStudentNo
Jump to PostIf you want the app to start with a new student by default then yes, but I'd have a "NEW STUDENT" button and put the code there. If NEW STUDENT displays a new form then you can put it in that form load event handler.
Jump to PostThis is actually a sql query to select max records from the database. For this you have to open a new recordset maybe. Better you can use
RS.Recordcount + 1
Jump to PostI would suggest you to use ADODB data control. Its more faster and prefect. anyway if you want to go with dao then here it is:
make a new data control for counting your records. put this query in your data controls "recordsource" property boxSELECT COUNT(*) …
All 15 Replies
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
NewCoder_31
0
Newbie Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Hamza Saleem
0
Newbie Poster
NewCoder_31
0
Newbie Poster
Hamza Saleem
0
Newbie Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
NewCoder_31
0
Newbie Poster
Hamza Saleem
0
Newbie Poster
Hamza Saleem
0
Newbie Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
NewCoder_31
0
Newbie Poster
Aslam Mansoor
2
Newbie Poster
NewCoder_31
0
Newbie Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.