|
-
Jun 27th, 2001, 09:26 AM
#1
Thread Starter
Fanatic Member
What's wrong with this code?
And how can I fix it?
Code:
Dim myDB As Database, myTable As TableDef, myRecordset As Recordset
Set myDB = OpenDatabase("C:\Data\" & InGeo & "ImpData.mdb")
Set myTable = myDB.TableDefs("MAIN")
Set myRecordset = myTable.OpenRecordset
myRecordset.Filter = "BATCHNO = '" & BatchNo & "' AND YEAR = '" & FYear & "'"
Set myRecordset = myRecordset.OpenRecordset
With myRecordset
.MoveFirst
etc. etc. I get a message "Operation is not supported for this type of object", in the line myRecordset.Filter = "BATCHNO
-
Jun 27th, 2001, 10:36 AM
#2
1) Have you created the reference from the project menu to the "MICROSOFT DAO OBJECT LIBRARY" properly ?
2) If you do a debug.print, do the following get returned as you expect them (ie not an extra "\" in the first one for example) :
-
Jun 27th, 2001, 11:31 AM
#3
Thread Starter
Fanatic Member
Alex - sorry, yes, all that stuff works fine. The problem is this method of applying a filter to the recordset, which, for this method, there's no help for.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|