Forum Discussion
jmtreky
Feb 19, 2020Copper Contributor
MS Access
on an input form, how can I keep the previous entry for a field as default for future entries
- WoldmanIron Contributor
One way to do this is entering VBA-code like this in the code module for the input form:
Private Sub Form_AfterUpdate()
TempVars("CustID") = Me.CustID.Value
TempVars("OrderType") = Me.OrderType.Value
End SubPrivate Sub Form_Current()
If Me.NewRecord = True ThenMe.CustID.Value = TempVars("CustID")
Me.OrderType.Value = TempVars("OrderType")End If
End Sub
You can replace and extend the field names to your convenience.
Best wishes,
Tieme