How to bring forward a value from previous record

  • Thread starter Thread starter Monica
  • Start date Start date
M

Monica

I have a form where I enter a number of records each day recording employees
names and the jobs they completed for that day. So one employee might have 5
or more jobs against there name for that day. What I want to achieve is that
when I start entering in the employee name this name would stay in there for
the next record until I change the name and then this changed name would be
auto entered into the next record until I change it again? I think there is
an easy soln but cannot find it
 
I have a form where I enter a number of records each day recording employees
names and the jobs they completed for that day. So one employee might have 5
or more jobs against there name for that day. What I want to achieve is that
when I start entering in the employee name this name would stay in there for
the next record until I change the name and then this changed name would be
auto entered into the next record until I change it again? I think there is
an easy soln but cannot find it

You can set the control's DefaultValue property in its own AfterUpdate
property. The code might look like:

Private Sub controlname_AfterUpdate()
Me!controlname.DefaultValue = """" & Me.controlname & """"
End Sub

The quotemarks are because the default value property must be a text string,
regardless of the datatype of the field.
 
Thankyou - worked a treat

John W. Vinson said:
You can set the control's DefaultValue property in its own AfterUpdate
property. The code might look like:

Private Sub controlname_AfterUpdate()
Me!controlname.DefaultValue = """" & Me.controlname & """"
End Sub

The quotemarks are because the default value property must be a text string,
regardless of the datatype of the field.
 
Back
Top