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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default field to previous value 1

Status
Not open for further replies.

stuandwil

Technical User
Apr 16, 2004
24
GB
Is it possible to populate a field with its previous value. A record is added every hour, a product is chosen from a drop down. 98% of the time it stays the same but every now and again the product will change.
 
In the AfterInsert event procedure of the Form set the DefaultValue property of the product to it's actual value.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 

not sure how to implement what you say, I have this but not working as yet.

Private Sub Form_AfterInsert()
[cboproduct].DefaultValue = cboproduct
End Sub
 
Create a query that shows only the last record. In the default value of the control on the form you can do:
=DLast("fieldname","qryMost_Recent_Record")
 
many thanks, I have it working from your example.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top