GeorgeDurkee
Programmer
I have a table with a number of indexes built into it. I want to let the user select which way he wants to view the data by using these indexes. How do I tell Access to use one my indexes?<br><br>The only things I can seem to find refer to creating a new index, not using an existing one. I took the following from the example, but it gives me an error (Operation is not supported for this type of object) when assigning a value to .INDEX. All I did from the example was change the name of the table.<br>==============================================<br> Dim dbs As Database<br> Dim tdf As TableDef<br> Dim rst As Recordset<br> Dim idxLoop As Index<br><br> Set dbs = CurrentDb<br> Set rst = dbs.OpenRecordset("tblMaster"<br> Set tdf = dbs.TableDefs!tblmaster<br><br> With rst<br> For Each idxLoop In tdf.Indexes<br> .Index = idxLoop.Name <<<<=========<br> Next idxLoop<br> .Close<br> End With<br><br> dbs.Close<br>=====================================================<br><br>Any ideas?<br><br>Thanks