|
-
Mar 15th, 2000, 03:16 PM
#1
Thread Starter
Junior Member
sorry about the topic it should be "can't " not "can" :þ
I was using the DAO 3.6 database, to begin a search i move my recordset to the first one using the command data1.recordset.movefirst, it's work for the first time. but the when the command is use again for the second time it return and error, why??? How can i solve this problem?
-
Mar 15th, 2000, 09:33 PM
#2
Lively Member
Where you want the MoveFirst Method do this:
If rst.BOF = False then MoveFirst
-
Mar 16th, 2000, 09:59 AM
#3
Thread Starter
Junior Member
still have problem?
yeah, i have use the the If rst.BOF = False then MoveFirst
method before in this way: but it still giving the same result - give the error message.
-
Mar 16th, 2000, 10:53 AM
#4
Guru
This code works fine with DAO 3.6 & Access 2000 db:
Code:
Dim db As Database
Dim rs As Recordset
Set db = DBEngine.OpenDatabase("Nwind2k.mdb")
Set rs = db.OpenRecordset("Select * from Customers")
Debug.Print rs.Fields(0).Value
rs.MoveFirst
rs.MoveNext
rs.MoveNext
Debug.Print rs.Fields(0).Value
rs.MoveFirst
rs.MoveNext
rs.MovePrevious
Debug.Print rs.Fields(0).Value
rs.MoveFirst
rs.MoveFirst
Debug.Print rs.Fields(0).Value
What does your code look like?
-
Mar 16th, 2000, 12:56 PM
#5
Thread Starter
Junior Member
First i put some data from the db to a combo box(not link to the db), after that the user can key in or click the combobox list to enter the choice. so the rs have move first twice, first time so get the data to put to the combo box second time is when the user choice the input. I'm was using the code almost same like john, just i'm using
"If Not rst.BOF Then rst.movefirst".
-
Mar 16th, 2000, 04:27 PM
#6
Lively Member
What sort of recordset do you have. Is it forward-only?
-
Mar 21st, 2000, 03:21 PM
#7
Thread Starter
Junior Member
Sorry for my late reply Michael, i'm not sure about the forward-only thing, but i have find out that this problem just occur in the current form, so may be there is some coding problem some way in my form thats make this happen, i'm still checking the source code. Any suggestion?
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
|