URGE: Conocer el nombre de un indice de una tabla
Hol@
Necesito saber cual es la instrucción/es para saber si existe o no un determinado indice en una tabla para podr crearlo en caso negativo.
Ya que el dgte trozo de código me esta dando Error rn T.de Ejecución
Function ExisteIndice() As Boolean
Dim dbs As Database
Dim existe_indice As Boolean
Dim miTabla As TableDef
Dim idx As Index
Set dbs = CurrentDb
Set miTabla = dbs!HISTORICO_PLC
existe_indice = False
With miTabla
Select Case .Indexes.Name
Case "ÍndiceHISTORICO_PLC"
existe_indiceHISTORICO = True
Exit Function
Case "KK"
existe_indiceHISTORICO = True
End Select
End With
End Function
Necesito saber cual es la instrucción/es para saber si existe o no un determinado indice en una tabla para podr crearlo en caso negativo.
Ya que el dgte trozo de código me esta dando Error rn T.de Ejecución
Function ExisteIndice() As Boolean
Dim dbs As Database
Dim existe_indice As Boolean
Dim miTabla As TableDef
Dim idx As Index
Set dbs = CurrentDb
Set miTabla = dbs!HISTORICO_PLC
existe_indice = False
With miTabla
Select Case .Indexes.Name
Case "ÍndiceHISTORICO_PLC"
existe_indiceHISTORICO = True
Exit Function
Case "KK"
existe_indiceHISTORICO = True
End Select
End With
End Function