My Assistant
![]() ![]() |
|
|
May 9 2007, 06:41 PM
Post
#1
|
|
|
UtterAccess Member Posts: 36 From: Adelaide, South Australia |
Hi everyone,
I have a command button on a form that uses the data entered into an unbound textbox as the criteria for a seek on an applicable index field of a recordset. I have the seek process of finding a record working in other modules - but in this instance I get the error message 'Operation is not supported for this type of operation' ??? Code: Dim db As Database Dim rstVehs As DAO.Recordset Dim strRego As String Set db = CurrentDb() Set rstVehs = db.OpenRecordset("tblVehicles") strRego = [Forms]![frmOpLookup]![txtRegoNo] rstVehs.Seek "=", strRego It fails on .Seek command line - What am I doing wrong ? Any help appreciated. |
|
|
|
May 9 2007, 06:45 PM
Post
#2
|
|
|
UtterAccess Editor Posts: 13,753 From: England (North East / South Yorks) |
You've not specified an index - however the problem is perhaps that tblVehicles might not be a local table.
Is it linked? |
|
|
|
May 9 2007, 06:53 PM
Post
#3
|
|
|
UtterAccess Member Posts: 36 From: Adelaide, South Australia |
Sorry, I forgot to show the index line of code in my previous post:
rstVehs.Index = "PrimaryKey" (which is placed before the seek command line) But you're also correct - the tables are now linked - which they weren't when I previously used this seek process in another module. So what do I now need to do differently - now my tables are linked. Thanks |
|
|
|
May 9 2007, 07:14 PM
Post
#4
|
|
|
UtterAccess Editor Posts: 13,753 From: England (North East / South Yorks) |
Yep - you're opening a dynaset recordset by default now.
Only Table type recordsets support Seek - and you can't open a linked table in that mode. Your choices are outlined (eventually) in this thread here. If you need that abbreviated at all, no probs - just ask :-) |
|
|
|
May 9 2007, 08:08 PM
Post
#5
|
|
|
UtterAccess Member Posts: 36 From: Adelaide, South Australia |
Thank you Leigh - much appreciated. Peter
|
|
|
|
May 10 2007, 03:43 AM
Post
#6
|
|
|
UtterAccess Editor Posts: 13,753 From: England (North East / South Yorks) |
No worries.
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 23rd May 2013 - 11:55 PM |