Keeping data in column for new record

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

Guest

How do I enter a record and have some of the information in the form show up
on the next record until I change it.
 
Hi Sunnie

Use the DefaultValue property of the control that you want to preset. You
can set the DefaultValue easily in your form's VBA code. The place to do it
depends on your needs.

Generally, the control's AfterUpdate property is the best place, so whenever
the user enters a new value, that value becomes the default value for the
next record. If you have a lot of controls, you could have a
general-purpose function for the job:

Public Function UpdateDefaultValue()
With Screen.ActiveControl
.DefaultValue = """" & .Value & """"
End With
End Function

Then, just set the AfterUpdate property for the required controls to:
=UpdateDefaultValue()

Note that DefaultValue is a string, and so should be enclosed in quotes.
 

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

Back
Top