Solved

AutoNumber data type

Posted on 1998-12-13
4
409 Views
Last Modified: 2012-06-21
When creating a field with VB, if the type is TEXT, the data type is dbText, MEMO is dbMemo, etc.
What is the data type constant for creating an AutoNumber field type?
Or how would I create it in VB without going into MS Access.
0
Comment
Question by:BWATERS
  • 2
4 Comments
 
LVL 5

Expert Comment

by:AnswerTheMan
Comment Utility
hear my advice - never use that type. it's just trubles.
have your own method of generating next number (long)
0
 

Author Comment

by:BWATERS
Comment Utility
yes, maybe so, thank you...but that doesn't answer my need...
0
 
LVL 15

Accepted Solution

by:
ameba earned 100 total points
Comment Utility
fld is AutoNumber if:
1. (fld.Type = dbLong)
2. ((fld.Attributes And dbAutoIncrField) = dbAutoIncrField)

And it is OK if you use it without user knowing it exists. Of course, if you use it for some type of numbering, visible to user, you are in trouble. Don't expect you will be able to fill gaps (holes) in generated numbers.

0
 
LVL 15

Expert Comment

by:ameba
Comment Utility
BWATERS, you can use 'Visual Data Manager' (Add-Ins menu) instead of Access. Well, you can't define relations in it, but its source is available - Visdata.Vbp in samples directory.

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now