Retain Value of Previous Record

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!
 
J

Jeanette Cunningham

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
 
B

Bart

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
 

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