How to id an autonumber field in code?

D

Don Culp

When looking at the TYPE of the field in code, the return
value is a LONG (I understand why). I want to be able to
distinguish between a Long and an Autonumber field.
The "New Values" property of the Autonumber field type
cannot be checked because it doesn't seem to be available
in code.
 
W

William Wang[MSFT]

Hi Don,

You may check the Attributes property of the Field object like this:

if Fld.Attributes = dbAutoIncrField then

Sincerely,

William Wang
Microsoft Partner Online Support

Get Secure! - www.microsoft.com/security
=====================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
=====================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "Don Culp" <[email protected]>
| Sender: "Don Culp" <[email protected]>
| Subject: How to id an autonumber field in code?
| Date: Sat, 16 Aug 2003 22:05:02 -0700
| Lines: 6
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNkfR2gOU84Z9WCQqGgyloUuioJcA==
| Newsgroups: microsoft.public.access.tablesdbdesign
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.tablesdbdesign:67922
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.access.tablesdbdesign
|
| When looking at the TYPE of the field in code, the return
| value is a LONG (I understand why). I want to be able to
| distinguish between a Long and an Autonumber field.
| The "New Values" property of the Autonumber field type
| cannot be checked because it doesn't seem to be available
| in code.
|
 

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