I have a sql table linked to my Database, dbo_Customers the primary index is PK_Customers.
When I run the code it errors on:
rstCustomers.Index = "PK_Customers"
I get the following error:
Operation is not supported for this type of object.
Here is the start of the code.
Set db = CurrentDb
Set rstActiveCustomers = db.OpenRecordset("ztbl_CodeGreen")
rstActiveCustomers.Index = "PrimaryKey"
Set rstProductSold = db.OpenRecordset("qry_Purchases")
rstActiveCustomers.Index = "PrimaryKey"
Set rstCustomers = db.OpenRecordset("dbo_Customers")
rstCustomers.Index = "PK_Customers"
Any help would be appreciated.
Razor1
When I run the code it errors on:
rstCustomers.Index = "PK_Customers"
I get the following error:
Operation is not supported for this type of object.
Here is the start of the code.
Set db = CurrentDb
Set rstActiveCustomers = db.OpenRecordset("ztbl_CodeGreen")
rstActiveCustomers.Index = "PrimaryKey"
Set rstProductSold = db.OpenRecordset("qry_Purchases")
rstActiveCustomers.Index = "PrimaryKey"
Set rstCustomers = db.OpenRecordset("dbo_Customers")
rstCustomers.Index = "PK_Customers"
Any help would be appreciated.
Razor1