Prefill Form

  • Thread starter Thread starter Edgar Chado via AccessMonster.com
  • Start date Start date
E

Edgar Chado via AccessMonster.com

Is there an Easy way to auto fill certain fields in a form from data of a
previous record?

In my case I have an order, and I wish to create a new one using data from
a previous record. I need this new record to have its own ID, but re use
some of the date of a previous record.

It should be able to use the data from any record and not just the previous
one.

Thanks
 
Using a continuous form or a datasheet form you can copy a record and paste
it to a new one. You can do the same thing in code. There is even a Wizard
to write the code to Duplicate records (although the code is embarrassingly
archaic)
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Arvin,

Thanks for your reply.

What I need is an easy way to populate a form with certain data from a
prevous record, so the users do not need to type all the data again.

Is this possible?
 
It is possible with the immediately previous record. You can set the
defaultvalue property so that each subsequent record tales the value of the
control of the previous record. In the AfterUpdate event for the control put

Me.ControlName.DefaultValue="""" & Me.ControlName & """"

Enclosing the value within 4 double-quotes is the iron clad
way to set the defaultvalue for any datatype
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top