Query two at a time in a recordset
Posted on 2006-11-14
I am trying to retrieve records in my Access database. I use the following code to retrieve records and place them in text fields. However, I only allow two text boxes on my form and the results from my query are definitely more than two. So I need to be able to collect two records at a time in a record set until I finish modifying the data in the that record set.
How do I write the code to input the two values at a time from the queried recordset into Text1 and Text2?
esql = "select * from frm2SectionI where ID =" & Text1
rec.Open (esql), conn, adOpenDynamic, adLockOptimistic
Text1 = rec.Fields(1)
Text2 = rec.Fields(2)
If Not rec.EOF Then rec.MoveNext