Retain Value of Previous Record

  • Thread starter Thread starter Bart
  • Start date Start date
B

Bart

I have a form name "notepad", field name "topic" and "Add Record" command
button. I want the value of the field name "topic" to be retained everytime I
click the command button "Add Record" to avoid retyping of the values in the
field name. Any help?

Thanks!
 
Hi Bart,
you could set the default value for that field/control in its after update
event.
When user opens the form it will be blank, after they enter a value it will
be entered for the next record.

Private Sub Topic_AfterUpdate()
Me.Topic.DefaultValue = """" & Me.Topic & """"
End Sub

Note: that is 4 double quotes either end of
& Me.Topic &


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
It works! Thanks Jeanette

Jeanette Cunningham said:
Hi Bart,
you could set the default value for that field/control in its after update
event.
When user opens the form it will be blank, after they enter a value it will
be entered for the next record.

Private Sub Topic_AfterUpdate()
Me.Topic.DefaultValue = """" & Me.Topic & """"
End Sub

Note: that is 4 double quotes either end of
& Me.Topic &


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Back
Top