Richard, For some reason my recordset is going to the last record I have saved in my table. As I change the last record in the table, sure enough that's what comes up in the FirstName box. I can't figure out how I'm messing up the syntax. Here's the code I have saved: Private Sub Command0_Click() Dim db As dao.Database Dim rs As Recordset
Set db = CurrentDb Set rs = db.OpenRecordset("ChildT")
rs.MoveFirst While Not rs.EOF FirstName = rs!FirstName rs.MoveNext Wend
rs.Close db.Close
Set db = Nothing Set rs = Nothing
Is there something wrong right in front of me that I'm not noticing?
Reply from Richard Rost:
If you don't specify a sort order in your recordset, you cannot be guaranteed that the records will be in any particular order. If you want to FORCE them to sort in order, you need to say something like:
Set rs = db.OpenRecordset("SELECT * FROM ChildT ORDER BY ChildID")
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Microsoft Access 320.