Link to home
Start Free TrialLog in
Avatar of nuritat
nuritatFlag for Israel

asked on

Access 2007 create index by vb

Hi
I'm trying to create an index to a table on Access 2007
like this:

Set idx = tdf.CreateIndex("PrimaryKey")
With idx
     .Fields.Append .CreateField("field1")
     .Fields.Append .CreateField("field2")
End With
idx.Primary = True
tdf.Indexes.Append idx

it used to work for me on earlier versions of access but now I get an error on " .CreateField"
saying: "Method or data memeber not found"

any idea?

Thanks
SOLUTION
Avatar of OxonDev
OxonDev
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nuritat

ASKER

Thanks

adding the DAO.index was enough

Avatar of nuritat

ASKER

I'd like to aword the points
I think you closed this question by mistake.  You can generate a request in Community Support for Moderator review to reverse this.
Avatar of nuritat

ASKER

No, It was not a mistake, the answer was perfect I even awarded the points already, why should I open it again?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nuritat

ASKER

I already awarded the pointes twice,  whats worng?
Hi nuritat.  It seems to be sorted now.  Thankyou.