How to bring forward a value from previous record

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
 
J

John W. Vinson

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.
 
M

Monica

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top