PC Review


Reply
Thread Tools Rate Thread

Creating autonumber field programmatically

 
 
Amy Blankenship
Guest
Posts: n/a
 
      11th Jul 2006
When you're creating a table definition, what is the constant to make a
field an autonumber vs an integer?

TIA;

Amy


 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      11th Jul 2006
How are you creating the table?

If you're using DAO, you need to set the field's Attribute to include
dbAutoIncrField

Set tdf = dbs.CreateTableDef("Contacts")
Set fld1 = tdf.CreateField("ContactID", dbLong)
fld1.Attributes = fld1.Attributes + dbAutoIncrField

If you're using DDL, the type is COUNTER.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Amy Blankenship" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> When you're creating a table definition, what is the constant to make a
> field an autonumber vs an integer?
>
> TIA;
>
> Amy
>



 
Reply With Quote
 
Amy Blankenship
Guest
Posts: n/a
 
      11th Jul 2006
Thanks a bunch!

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:%(E-Mail Removed)...
> How are you creating the table?
>
> If you're using DAO, you need to set the field's Attribute to include
> dbAutoIncrField
>
> Set tdf = dbs.CreateTableDef("Contacts")
> Set fld1 = tdf.CreateField("ContactID", dbLong)
> fld1.Attributes = fld1.Attributes + dbAutoIncrField
>
> If you're using DDL, the type is COUNTER.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Amy Blankenship" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> When you're creating a table definition, what is the constant to make a
>> field an autonumber vs an integer?
>>
>> TIA;
>>
>> Amy
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating an Autonumber field Ed Cohen Microsoft Access 2 9th Jun 2008 04:17 AM
Creating Autonumber Field =?Utf-8?B?SmFtZXM=?= Microsoft Access VBA Modules 1 20th Feb 2007 07:33 PM
Creating a table with an autonumber field =?Utf-8?B?TUNocmlzdA==?= Microsoft Access VBA Modules 1 22nd Jun 2005 10:19 PM
AutoNumber Field's value when creating a new record =?Utf-8?B?TGVzbGVl?= Microsoft Access Form Coding 1 22nd Apr 2004 03:35 AM
Re: Creating an 'autonumber' field in a report Cheryl Fischer Microsoft Access Reports 0 16th Sep 2003 06:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:52 AM.