Carrying over values in a form to a new record

  • Thread starter Thread starter Andy Roberts
  • Start date Start date
Andy,
No, it will work for as many fields as you need. Use the Afterupdate event of "each"
control to set the Default Value to the just entered value, for those fields you want to
"remember" for the next new record.
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
Before I can answer that, you need to tell us which criteria you want to
use. Selected controls? All controls? Only text boxes? The entire record
(why?)? Each requires something different to optimally work.
 
Andy Roberts said:
Dev Ashish explains the process here of what I want to do perfectly here:

http://www.mvps.org/access/forms/frm0012.htm

However it only seems to work with one control. What do I need to do if
there are more than one control I wish to carry over?

The code is:

'******** Code Start **********
const cQuote="""" 'Thats two quotes
me!Control.DefaultValue = cQuote & me!Control.Value & cQuote
'******** Code End **********

As you no doubt figured out, you change the "Control" in the sample to the
name of your Control. If you put the code in the Form's AfterUpdate event,
you just add another similar line for each Control whose value you want to
carry to the next new Record.

If you only want to carry forward a single Control's value, when that
control is changed, you could put the code in the AfterUpdate of that
Control. I see no advantage to this over putting the code in the Form's
AfterUpdate.

Once you do enter save a value in the DefaultValue property, that default
will apply until changed by the user entering and updating the Control again
(I believe in some versions prior to Access 2003, the property setting
applied only as long as the Form was open, but in Access 2003, the Default
Value set in Form view will persist across closing and reopening the Form
and across closing and reopening the Database).

Larry Linson
Microsoft Access MVP
 
Hi Larry

can i ask further to your entry...

how do you make so that the carry-over lasts only so long as the form is open?

Cheers
Chris
 
Back
Top