at 1st: class name entry in a text box (by add new button). access file is store it. then in a another form (when a student admitt) enter all data of this student (in few text box) without class name. when I want to entry the class name then I press enter button and then a form show with msflexgrid and the msflexgrid show that data what I entry at 1st.(I doit for save the time).
however, here I want, a student admitt in class nine. his roll is 01
I entry it manualy. and class name entry by that way. second time another student admitt in class ten. roll is 04. I want when I enter class name the roll no. will entry automatically. I mean I enter class ten the roll will 05. (the last roll will show, cause I don't know what was the last roll in every class). How can I do it. help me any body please.
Recommended Answers
Jump to PostBy roll, I take it you mean enrolled in such class whatever number it may be...
So, you have a TableOfClasses table and a StudentsTable table and you want to know how many students have been enrolled in whatever class. So lets add another table, TableEnrollment.
The fields …
Jump to PostOkay, looking at project now and I have some suggestions...
Under the add new button you should add a check to see if there is information to add...
You should also check to see if the class exists...
Private Sub cmdaddnew_Click() On Error GoTo cmdaddnew_ClickError …
Jump to PostNow, I know that does not solve your problem but you have the hints in the add new button on how to find out how many students are enrolled. If you need any more help just ask.
Good Luck
Jump to PostOkay, this was the query I was pointing you too earlier...
S = "SELECT COUNT(*) AS THECOUNT FROM Table1 WHERE class = '" & Trim(Text1.Text) & "'"
You just need to adjust which table it points to (table1 vs. table2) and which field it points to.
…
Jump to PostOkay, don't need to change field name (sorry forgot how you had your tables designed), just change Table1 to Table2 and you will have you count of how many records in Table2 = whatever class name. Then on your roll field when you do your addnew you would use THECOUNT …
All 27 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.