Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a Index on a linked Sql Table

Status
Not open for further replies.

Razor1

IS-IT--Management
Nov 21, 2002
81
US
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
 
Why do you want to use the Index property ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I need to get information from the customer table to use in a different table and query

Razor1
 
Why not use the FindFirst method ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I was not aware of that command. Thanks it worked!!!

Razor1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top