Sub SingleField_Index()
Dim conn As ADODB.Connection
Dim strTable As String
On Error GoTo ErrorHandler
Set conn = CurrentProject.Connection
strTable = "myTable"
conn.Execute "CREATE TABLE " & strTable _
& "(Id INTEGER, " _
& "SName CHAR (30), " _
& "CONSTRAINT idxSupplierName UNIQUE " _
& "(SName));"
Application.RefreshDatabaseWindow
ExitHere:
conn.Close
Set conn = Nothing
Exit Sub
ErrorHandler:
Debug.Print Err.Number & ":" & Err.Description
Resume ExitHere
End Sub
|