Access97: Difference between Autonumber and Long?

  • Thread starter Jonathan Scott via AccessMonster.com
  • Start date
J

Jonathan Scott via AccessMonster.com

I am trying to programmatically find the difference between a Long and and
Autonumber field. Field.Type both come out as Long. Can someone be so kind as
to explain to me how I can differentiate between the two, programmatically?

TIA,
Jonathan Scott
 
C

ChrisJ

Dim db As Database
Dim tdf As TableDef
Dim fld As Field

Set db = CurrentDb()
Set tdf = db.TableDefs("Table1")
Set fld = tdf.Fields("test")
'for LONG, fld.attributes = 1
'for Autonumber, fld.attributes = 17
 
J

Jonathan Scott via AccessMonster.com

Thanks Chris,

I JUST found out that there is a dbAutoIncrField attribute, which I now AND
with the field's attributes to see if that flag is standing or not.

Thanks!
Jonathan Scott
 

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

Top