i am trying this from last 2 days but unsuccessful .
i am trying to make a project in visual basic 2010 which is connected with ms access 2010 database. the database having 4 tables i.e. tblsession, tblcourse, tbllevel, tblstudentregistration.
column name column data
sessionID -- 01
sessionname -- 2012
01 --- Ab
02 --- Ac
03 --- Ad
01 --- I
02 --- II
03 --- III
studentID StudentName and so on.......................
i have a form in visual basic 2010 which is having
comboboxsession - the data comes form tblsession
comboboxcourse - the data comes form tblcourse
comboboxlevel - the data comes form tblcourse
txtstudentID - here i want to generate an unique ID for all students so that i can save all students data in one table.
it should be like this:
if i select 2012 in comboboxsession and if i select Ac in comboboxcourse and if i select II in comboboxlevel then
the txtstudentID must generate and unique ID like this "01020200001" where the first "01" should form sessionID second "02" from courseID third "02" from levelID and last "00001" must be generated from the Top ID in this pattern in the tblstudentregistration table. it should auto increment every time i click ADD button and selecting all comboboxes.
if i change the comboboxes selection like this
comboboxsession = 2012
comboboxcourse = Ad
comboboxlevel = III then
txtstudentID must show studentID like "201030300001" and if this ID already exist then it should show "2012030300002"
this is the thing i want.
please provide my some logical suggestion and if possible a code.
kindly help me for this.
thanks in advance