auto employee code

  • Thread starter Thread starter Desikankannan
  • Start date Start date
D

Desikankannan

sir,
iam doing project in vb.net with ms-access back end
i wants to create employee code like companyname+code
like western001....
pls help to genereate code
example once i save the button it will generate next code western0002.... so on

regards
Desikankannan.

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
 
before you insert a record, query your database for the maximum id
first. then assign your prefix with it.

e.g.
employee(id,name)

SQL DML : select max(id) from employee

when u're inserting a record, combine your prefix with the id+1 :

"western" & id_form_db+1

somehting like that.

gurus please correct me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top