R
RON
I've been working on this project and can now get it open and putting data
from two databases into my form.
The following code is run on the Form OPEN event and shows the first record
in the database....my question is, I now want to code for a FirstRecord,
LastRecord, NextRecord and PreviousRecord command button on the form. How
would I do this?
for example for next record would I just put in:
rst1.movenext
rst2.movenext
Is that all I need to do or is there more to it? Also what abot the other
command buttons?
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")
Rst2.MoveFirst
Rst2.Find "studentid=" & Rst1.Fields("studentid") & ""
Me.txtnokfname = Rst2.Fields("nokfirstname")
Me.txtnoklname = Rst2.Fields("noklastname")
Me.txtnokrelationship = Rst2.Fields("nokrelationship")
tanks.
from two databases into my form.
The following code is run on the Form OPEN event and shows the first record
in the database....my question is, I now want to code for a FirstRecord,
LastRecord, NextRecord and PreviousRecord command button on the form. How
would I do this?
for example for next record would I just put in:
rst1.movenext
rst2.movenext
Is that all I need to do or is there more to it? Also what abot the other
command buttons?
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")
Rst2.MoveFirst
Rst2.Find "studentid=" & Rst1.Fields("studentid") & ""
Me.txtnokfname = Rst2.Fields("nokfirstname")
Me.txtnoklname = Rst2.Fields("noklastname")
Me.txtnokrelationship = Rst2.Fields("nokrelationship")
tanks.