While I agree with "George (of the city, but longing for the country)"
concerning needing a little more info, from the way you posted your question
it would appear to me that you are wanting to capture a current value in a
field on your form and when the next new record is created, use that value as
the value for that field in the new record.
If this is the case then I would suggest that you declare a Public variable,
at a module level. In a module place the following statement:
Public varDefaultVal as variant
Then use code in the after update event of the field in question to assign
the value provided in the file to your public variable. Like:
varDefaultVal = me.NameOfControl
Substitute the "NameOfControl" in the statement above with the actual name
of your control.
Then when the new record is created you can set the value of this same field
to the value stored in the Public variable. Use the On Current event of your
form and place the following code:
Me.NameOfControl = varDefaultVal
Again, substitute the "NameOfControl" in the statement above with the actual
name of your control.
All of the above lines of code are "air code" and as such are completely
untested.
If you are simply moving to a new record and not closing the form before
moving to the new record then there is one other way that you could do this.
You could store the value of your control (field) in the "Tag" property of
either the form or the control that you are wanting to use the value of as
the default for the new record.
I would most likely use the "Tag" property of the control because in the
event that you wanted to do this with more than one field you can do the same
thing for as many fields (controls) as you need.
To do it this way, use the following line of code in "After Update" event of
the control:
me.NameOfControl.tag = Me.NameOfControl
Then place the following line of code in the "On Current" event of the form:
Me.NameOfControl = me.NameOfControl.tag
Substitute the "NameOfControl" in the statement above with the actual name
of your control.
This should assign the previous value of the control as the value for the
new record.
All of this is based on the presumption that I understood what you wanted to
do in the first place. If I misunderstood please just post back and someone
will try to help.
-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm