Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to capture the current record, when a user click a move-next arrow 1

Status
Not open for further replies.

maupiti

Programmer
Oct 27, 2003
240
US
Access 2003

How to capture the current record, when a user click a move-next arrow button on the control box.

/////////////////////////////////////////////

A form has three fields:
Customer_Number, Customer_Name, and Ordered_Date

When a user click an arrow-star button on the control box, Access move to the new record. How do I capture the fields on the form before it move to a new record.

When I use the "On Current" Event, Access move to the new field or next record, and the information that it capture is the record that it moved to, not the previous one.
 
Look at Order of events for database objects in the access help files. If the data has changed, you may want to use different events than if it has not.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Here is an approach:

Dim oldValue As String
Dim newvalue As String

Private Sub Form_Current()
oldValue = newvalue
newvalue = Me.txtBxLastName
MsgBox oldValue & " " & newvalue
End Sub

Regardless if the data is changed or not this captures the old value from the record I came from in either direction.

This may be simpler if you are only trapping changed data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top