1.11M Members

Database problem

 
0
 

Dear All.
I have developed College management system ,and using VB6 tools as front and MS Access as database ,I want to generate autoID of students according to their technologies,for example for Electrical....... 01ELE,For Computer ....... 02Comp ,for Civil.... 03CL etc or Pls Give me suggestion t o create new tables for every technologies?

 
0
 

Hi Zeb,

You can not set the field in your table to auto increment, it will only accept integers type like 1,2,3,4 etc. The way around this is to do the following -

''Open your recordset.... SELECT * FROM etc...

Dim xCount As Integer, strRec As String

xCount = rsRecordset.Recordcount
xCount = xCount + 1

strRec = xCount & "ELE"

Now, when you add a new record to your database, use strRec as the field id.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: