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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indexed.Yes(Duplicates OK)

Status
Not open for further replies.

peljo

Technical User
Mar 3, 2006
91
BG
In my code for remote control i wanted to remove the property Indexed of a field, but i receive the date type conversion error.How can i change these properties by code ?
At the end of the list of the properties of the field,just below Required, it is written Indexed.Yes (Duplicates OK). i want to turn it to No and i write False, but it says property is unkown. What is the exact property and the command to turn it to No ?

Below is a part of my code
Set tdf = dbs.TableDefs("customers")
Set fld = tdf.Fields("afid")
fld.Properties("Indexed") = False
dbs.Close
Set fld = Nothing
Set tdf = Nothing
Set dbs = Nothing
Set wsp = Nothing

etc

The Access interface is not the same as the DAO object model. I know I will have to loop through the Indexes collection of the TableDef, and loop through the Fields collection of each index to see if the field is among them.
And if so, to delete the index. Of course, it is much easier to delete the index in the Access interface,but for the time being I cannot do that, I have no access to the Access interface and i will have to send the code and beside I have about 7 users in different towns that makes the matter difficult to me.
Is it possible to help me writing out the code for that? I will be much indebted..
 
Have a look at the "DROP INDEX" DDL instruction.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
. . . or have a look at the [blue]Indexes Collection[/blue].

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top