1,105,578 Community Members

Database problem

Member Avatar
Junior Poster
109 posts since Jun 2010
Reputation Points: -6 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 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?

Member Avatar
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]

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.

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