I was creating a text box to work with the following, provided by the Microsoft site. I really need the value to be updated in my bound field. Also, it was providing a value based on the previous record, not the previous filtered record. If my current field is "Partnership", I want the new record to return this value. It was returning "Direct" which was the value in the previous unfiltered record.
Function AutoFillNewRecord (F As Form)
Dim RS As Dynaset
Dim I As Integer, RetVal
Dim FillFields As String, FillAllFields As Integer
On Error Resume Next
' Exit if we are not on the new record.
RetVal = F.Bookmark
If Err = 0 Then Exit Function
Err = 0
' Go to the last record of the form recordset (to autofill from).
Set RS = F.Dynaset
RS.MoveLast
' Exit if we cannot move to the last record (no records).
If Err <> 0 Then Exit Function
' Get the list of fields to auto fill.
FillFields = ";" & F![AutoFillNewRecordFields] & ";"
' If there is no criteria field, then set flag indicating
' ALL fields should be auto filled.
FillAllFields = Err <> 0
DoCmd Echo False
' Visit each field on the form.
For I = 0 To F.Count - 1
' Fill the field if ALL fields are to be filled OR if the
' ControlSource field can be found in the FillFields list.
If FillAllFields Or InStr(FillFields, ";" & F(I).ControlName _
& ";") > 0 Then
F(I) = RS(F(I).ControlSource)
End If
Next
DoCmd Echo True
End Function