default value previous record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I woulds appreciate any help on the following.
Combo box for Customer Names. Would like the form to autofill with the same
field from the previous record.
I have typed everything I can think of in the default value on the properties.
Thanks
Stacy
 
If this is a field's Default Value (design view of table), no such
capability.

If this is a control's Default Value (design view of form), then use code
similar to this on the AfterUpdate event of the combo box:

Private Sub ComboBoxName_AfterUpdate()
Me.ComboBoxName.DefaultValue = """" & Me.ComboBoxName.Value & """"
End Sub

Note that this will work for the second and subsequent entries once the form
has been opened. The next time you open the form, the first record will not
have the "correct" default value until you enter the first record of that
form's use.
 
Back
Top