Changing a table field property

S

Stephen

I posted this in the tables forum as well because i am not sure whether this
is a VB question or a table question.

Is there a way to change a table property through a VB code command.

Example:

I have a table called "tblCoupons"

One of the fields in this table is a called "CouponNumber". The Indexed
Property for this field is set to "Yes (No Duplicates)"

I want to run VB Code that will change the Property of this field to "Yes
(Duplicates OK)".

Is there a way to do thisin VB? I know I can just open the table in design
view and change it, but for reasons I won't go into (because it will be moot
for this discuss and thus waste your time, which I deeply value) I need to
do it in VB.

Thanks in advance.

-Stephen
 
A

Allen Browne

The property you mention is actually a property of the Indexes collection of
the TableDef.

If you have a reference to the DAO library for the version of JET that
matches your Access database, you can set the Unique property of the Index
to No.
 
T

TC

Answered elsewhere.

Stephen, please don't MULTI-POST. This is where you post the same question
seperately< to different newsgroups. When you multi-post, the people
reading one newsgroup, can not see any answers you got in other newsgroups.
People can easily waste their time by answering you in one newsgroup, not
knowing that other people have already answered >other< newsgroups.

Instead, CROSS-post. This is where you send the same message >once<, to
several newsgroups, simultaneously. You do this by including >all< the
relevant newsgroup names, in the Newsgroups line of your newsreader,
seperated by semi-colons (or whatever). Then, all of the answers that are
given in one newsgroup - say this one - are instantly visible in all the
other groups to which you cross-posted. This is much more valuable to the
general readership of the newsgroups, & more considerate of the people who
take time to answer.

Cheers :)
TC
 

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