default value previous record

S

Stacy

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
 
K

Ken Snell [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top