How can I set a default value at previous entry in Access?

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

Guest

I want to have default values set at what I entered in the same field on the
previous record. How do I do that?
 
I want to have default values set at what I entered in the same field on the
previous record. How do I do that?

On a Form, you can use the AfterUpdate event of the textbox (or other
control) bound to the field:

Private Sub controlname_AfterUpdate()
Me!controlname.DefaultValue = Chr(34) & Me!controlname & Chr(34)
End Sub

On a table or query datasheet...

you can't.

Use a Form.

John W. Vinson[MVP]
 
You can add code to the After Update event of your text box. For instance if
you have a text box "txtDept" that is bound to a text field. Your code would
look like:
Me.txtDept.DefaultValue = """" & Me.txtDept & """"
If the field is numeric, get rid of all the double-quotes. If date, use "#".
 
Back
Top