leave information in the field of an access 2003 form btwn record

A

angdenis

i need to have fields in the form that LEAVE the data in the field from the
previous record without doing the (ctrl ') to put that data in it. I thought
i could do a form in VBA to do that , but have not found out how. how? or
what language?
 
D

Douglas J Steele

You can set the DefaultValue property of the controls to the values of the
fields in the previous record.

In the form's AfterUpdate event, put code like:

Me.Control1.DefaultValue = Chr$(34) & Me.Control1 & Chr$(34)
Me.Control2.DefaultValue = Chr$(34) & Me.Control2 & Chr$(34)
Me.Control3.DefaultValue = Chr$(34) & Me.Control3 & Chr$(34)

and so on.

(Note that regardless of the data type of the field, the DefaultValue is
text, so the quotes, provided by Chr$(34), are required.)
 
F

fredg

i need to have fields in the form that LEAVE the data in the field from the
previous record without doing the (ctrl ') to put that data in it. I thought
i could do a form in VBA to do that , but have not found out how. how? or
what language?

For New Record entry?
Code the AfterUpdate event of the control:
Me![ControlName].DefaultValue = Me![ControlName]
 
Top