Default Value

  • Thread starter Thread starter DSmith
  • Start date Start date
D

DSmith

Is it possible to make whatever is inputted the default value of a field
until a different value is inputted?

Thanks in advance!
 
Is it possible to make whatever is inputted the default value of a field
until a different value is inputted?

Thanks in advance!

Yes; use the textbox's AfterUpdate event:

Private Sub textboxname_AfterUpdate()
Me!textboxname.DefaultValue = Chr(34) & Me!textboxname & Chr(34)
End Sub

The Chr(34) is the " quote character; the default value is a string
property regardless of the field's datatype.

John W. Vinson[MVP]
 
Works great, thanks so much!

John Vinson said:
Yes; use the textbox's AfterUpdate event:

Private Sub textboxname_AfterUpdate()
Me!textboxname.DefaultValue = Chr(34) & Me!textboxname & Chr(34)
End Sub

The Chr(34) is the " quote character; the default value is a string
property regardless of the field's datatype.

John W. Vinson[MVP]
 
I do have a problem--it only works on the current record and not for the
whole table. I need for it to work on everyone's record. So I guess I need
to change from AfterUpdate to ?
 
Back
Top