.Index

aziz rasul

Active member
Local time
Today, 15:23
Joined
Jun 26, 2000
Messages
1,935
When I write

Rst.Index = "Index1" I get the error message

"Operation is not supported for this type of object"

What am I doing wrong. I'm using Access 2000.
 
Last edited:
I would guess that the .Index property is Read Only. Check the help file.
 
what type of recordset

The index property is only available for certain types of recordsets. As chrismcbride suggested, check in help to find out which type of recordset supports the ".index".

HTH
 
I'm trying use an index called "Index1" which exists in the table set by the recordset "NIPOP Extended". However in order to use "Index1", I need to APPEND it to the Indexes collection. I don't know the code for the append operation. I don't want to change the index name, hence Read Only is OK.

Here's the essential snippet of code so far.

Dim i As Integer, IndexName As String, idf As Indexes

For i = 0 To DBEngine(0)(0).TableDefs("NIPOP Extended").Indexes.Count - 1
IndexName = DBEngine(0)(0).TableDefs("NIPOP Extended").Indexes(i).Name
'In order to use the index names in code, you need to append them. How?
Next i
 
Can you not just use:

DBEngine(0)(0).TableDefs("NIPOP Extended").Indexes.Append NewIndexName
 
I may be way off the mark, but when you go to the table design view, select View>>Indexes on the menubar. You're saying that "Index1" exists in that list? If so, disregard this, but if not you may need to add it to this list.

HTMS
 
DBEngine(0)(0).TableDefs("NIPOP Extended").Indexes.Append doesn't work. It complains when it sees the Append.

The index "Index1" is an index that exists in the table which I am trying to set using

rstNIPOP_Extended.Index = "Index1"

However before I can use the above line of code, I need to append the existing index (Index1) to the Indexes collection.
This is what I don't know how to do. Hope this clarifies things a bit more.
 

Users who are viewing this thread

Back
Top Bottom