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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using 'Seek' in DAO with linked tables

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello
I have a form that uses dao to access two tables and seek a particular record from each.
Set dbMyDBase = CurrentDb
Set rsMyRSet1 = dbMyDBase.OpenRecordset("tblParts")
Set rsMyRSet2 = dbMyDBase.OpenRecordset("tblPartList")
rsMyRSet1.Index = "PrimaryKey"
rsMyRSet1.Seek "=", Me.cboProductID
rsMyRSet2.Index = "PrimaryKey"
rsMyRSet2.Seek "=", Me.tbxPartOrderID, Me.cboProductID
The following code works fine when the tables are within the current DB (not linked) as soon as i split the database i get the following error message: Operation is not supported for this type of object.
Im just wondering why the following code will not work on a linked table. Any suggestions would be greatly appreciated.
 
Hi!

It doesn't work because you cannot open a linked table using dbOpenTable. You can open it as a Dynaset using dbOpenDynaset. To find the record you need you will want to use the FindFirst method. The general format is:

rst.FindFirst "YourIDField = '" & Me!YourControl & "'"

The code above assumes that the ID field is text. If it is numeric, leave out the single quotes.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top