Solve the Problem of repeatedly adding the same data to the list of student information management systems.

Source: Internet
Author: User
There are many errors in the student information management system that need to be solved. Next I will solve an error in the "Grade Course settings" form in the student information management system, "adding data repeatedly in the list ", when you set a course for a grade, you can add a course several times! Below I will demonstrate how to solve the problem of "adding data repeatedly in list" Code ! Private sub register add_click ()
Dim I as integer defines two Integer Variables
Dim J as integer 'Add a course to the listselectcourse list If listallcourse. listindex <>-1 then
Listselectcourse. additem listallcourse. List (listallcourse. listindex)
End if
For I = 0 to listselectcourse. listcount-1 'External Loop
For J = I + 1 to listselectcourse. listcount 'inner looping 'to determine whether the same data exists in the list
If listselectcourse. List (I) = listselectcourse. List (j) Then listselectcourse. removeitem j 'deletes the added data msgbox. "You have added a course. Please delete it before adding it! "Exit sub end if next J next I end sub


In this way, the same data will not be added again in the List table.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.