Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reference table field

Status
Not open for further replies.

optjco

IS-IT--Management
Apr 13, 2004
185
GB
Hi,
I am deleting a table and then making a new table from a query. can someone explain how i can set the index property of a field ("DueDate") to be Yes(No Duplicates) using vba code

Regards

Olly
 
The answer depends on what database model you are using: Access (DAO) or SQL Server (ADODB)

For DAO you access the TableDef object that has been created by the query and add an Index to its Indexes collection that has the appropriate properties.

For ADODB you can use SQL Server Data Definition Language SQL commands to add an index to the table or you can use the SQLDMO object to manipulate the indexes directly.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top