View Full Version : Fill form enteries based on previous record


RossW
10-20-2000, 05:20 AM
I have created a data entry form. In some instances, I want the value from the previous record (i.e. date, supplier name)to be automatically entered into the same field for the current record. Is there a way to do this other than using the [CTRL] + ' key sequence?

yeatmanj
10-20-2000, 05:29 AM
you can use a dlookup. it's in the help files. also, i think you can use autolookup. it is also in the help for access.

[This message has been edited by yeatmanj (edited 10-20-2000).]

Talismanic
10-20-2000, 07:17 AM
I use this on the OnExit Even of the last text control for my form. But you could set it to any event you like. This puts the last enterd value for your text boxes in the new rocords text boxes.

Private Sub txtPW_Exit(cancel As Integer)

With CodeContextObject

.JobNumber.DefaultValue = """" & .JobNumber & """"
.JobName.DefaultValue = """" & .JobName & """"
.WeekEnding.DefaultValue = """" & .WeekEnding & """"

End With

DoCmd.GoToControl "JobNumber"
DoCmd.GoToRecord acForm, "TimeSheetGR", acNewRec
End Sub


[This message has been edited by Talismanic (edited 10-20-2000).]