Cannot list data field in a form from a previous record

G

Guest

When I navigate from record to record in form view, I want a textbox/field of
the current record to display the data in a field from the previous record
immediately before it.

How do I perform this function in VBA or in expression builder?
 
T

Tom

Easiest solution is to use a continuous form but I guees that is not what
you are looking for.

Alternatively, you can use the following code where Name is the field value
you want to copy to the next record. Text2 is an unbound text field that
will display the value.

Dim txtCurrentName As String
Dim txtLastName As String

Private Sub Form_Current()
txtCurrentName = Nz(Me!Name, "")
Text2 = txtLastName
txtLastName = txtCurrentName
End Sub

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top