Can you help me please in this problem?
When I add a new student I need the form write automatically the student number in light of the class reference after choosing the class,
Can you help me in this code?
Can you help me please in this problem?
When I add a new student I need the form write automatically the student number in light of the class reference after choosing the class,
Can you help me in this code?
there already is a field called autonum. Wont this work?
If I understand correctly, if I add Sam and select student_class = 2, the student_number should be 20002?
(you misspelled the field name. You have "calss" instead of "class". And you have 2 twice..... missing a "3" in the values.)
In the after update event of the combo box "student_Class", you would open a query in code selecting the top 1 "class" sorted descending.
Then you would have to convert the text to a value, add 1, then push the new value into the "student_number" control on the form.
i corrected the name of fields . when i add a new student i need the form writ the student number in light of the classref from the class table.
can you please help me in doing that.
regards
autoNumber.zipIf I understand correctly, if I add Sam and select student_class = 2, the student_number should be 20002?
(you misspelled the field name. You have "calss" instead of "class". And you have 2 twice..... missing a "3" in the values.)
In the after update event of the combo box "student_Class", you would open a query in code selecting the top 1 "class" sorted descending.
Then you would have to convert the text to a value, add 1, then push the new value into the "student_number" control on the form.
You didn't answer my question about how the numbering should be incremented, so I used my best guess.
In table "Class", you have the field "Classref" defined as a Text type field. The data in that field looks like this: "650100000". The code will run as long as there is NOT a letter in that string. (Cannot have any thing like "6501C0000" or "65B010000")
I added a continuous form (Form1) to make it easier for texting.
The combo box on each form has the same code.
thank you , and sorry for my late response
i will tray using it and see the result
thank you very much
best regards
Dear ssanfu
And he's a jolly good fellow!
Have a look at DMax.
I think it would be more suitable than AutoNumber.
It may be helpful if you wish to use the same number more than once.