R
Ron
I have been working on this for days and can not get it to work.
With the current code for the next button I get an error that either
BOF or EOF has been reached.
Basically I want this code for the NEXT button to move through the
recordset table one record at a time and display it in the correct
textboxes.
With this code right before it errors RST1 textboxes display the last
record in the table, and rst2 textboxes do not get updated.
anyone help?
===
Private Sub Command21_Click()
'If Not Rst1.EOF Then
If Not Rst1.EOF Then
Rst1.MoveFirst
Do
Me.txtstudentid = Rst1.Fields("studentid")
Me.txtAddress = Rst1.Fields("studentaddress")
Me.txtStudentFName = Rst1.Fields("studentfirstname")
Me.txtStudentLName = Rst1.Fields("studentlastname")
Me.txtCity = Rst1.Fields("studentcity")
Me.txtState = Rst1.Fields("studentstate")
Me.txtZip = Rst1.Fields("studentzip")
Rst1.MoveNext
Loop Until Rst1.EOF
End If
If Not Rst2.EOF Then
Rst2.MoveFirst
Do
'move to next row of rst2
Rst2.Find "studentid=" & Rst1.Fields("studentid") & ""
Me.txtnokfname = Rst2.Fields("nokfirstname")
Me.txtnoklname = Rst2.Fields("noklastname")
Me.txtnokrelationship = Rst2.Fields("nokrelationship")
Rst2.MoveNext
Loop Until Rst2.EOF
End If
End Sub
With the current code for the next button I get an error that either
BOF or EOF has been reached.
Basically I want this code for the NEXT button to move through the
recordset table one record at a time and display it in the correct
textboxes.
With this code right before it errors RST1 textboxes display the last
record in the table, and rst2 textboxes do not get updated.
anyone help?
===
Private Sub Command21_Click()
'If Not Rst1.EOF Then
If Not Rst1.EOF Then
Rst1.MoveFirst
Do
Me.txtstudentid = Rst1.Fields("studentid")
Me.txtAddress = Rst1.Fields("studentaddress")
Me.txtStudentFName = Rst1.Fields("studentfirstname")
Me.txtStudentLName = Rst1.Fields("studentlastname")
Me.txtCity = Rst1.Fields("studentcity")
Me.txtState = Rst1.Fields("studentstate")
Me.txtZip = Rst1.Fields("studentzip")
Rst1.MoveNext
Loop Until Rst1.EOF
End If
If Not Rst2.EOF Then
Rst2.MoveFirst
Do
'move to next row of rst2
Rst2.Find "studentid=" & Rst1.Fields("studentid") & ""
Me.txtnokfname = Rst2.Fields("nokfirstname")
Me.txtnoklname = Rst2.Fields("noklastname")
Me.txtnokrelationship = Rst2.Fields("nokrelationship")
Rst2.MoveNext
Loop Until Rst2.EOF
End If
End Sub