pattyt
12-17-2001, 11:28 AM
is there a combination of keys or something if you are working on a form and want to fill in the fields with the previous records fields?
|
View Full Version : need to duplicate previous record using a form pattyt 12-17-2001, 11:28 AM is there a combination of keys or something if you are working on a form and want to fill in the fields with the previous records fields? Jack Cowley 12-17-2001, 12:19 PM You can use the Ctrl + ' combination, you can use a Function or you can use something like this (I have used a field called FirstName. Replce it with the actual name of your control.): In the After Update event put this code: Private Sub FirstName_AfterUpdate() Me![FirstName].Tag = Me![FirstName].Value End Sub In the On Enter event put this code: Private Sub FirstName_Enter() If Not Me.NewRecord Then Exit Sub If Not (IsNull(Me![FirstName].Tag) Or Me![FirstName].Tag = "") Then Me![FirstName].Value = Me![FirstName].Tag End If End Sub This article will show you how to write a Function to fill your fields.... http://support.microsoft.com/support/kb /articles/Q210/2/36.ASP?LN=EN-US&SD=gn&FR=0&qry=q210236&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=ACC2000 (http://support.microsoft.com/support/kb/articles/Q210/2/36.ASP?LN=EN-US&SD=gn&FR=0&qry=q210236&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=ACC2000) [This message has been edited by Jack Cowley (edited 12-17-2001).] |