A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to bring forward a value from previous record



 
 
Thread Tools Display Modes
  #1  
Old March 22nd, 2010, 04:20 AM posted to microsoft.public.access.forms
Monica
external usenet poster
 
Posts: 67
Default How to bring forward a value from previous record

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

  #2  
Old March 22nd, 2010, 04:31 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default How to bring forward a value from previous record

On Sun, 21 Mar 2010 21:20:01 -0700, Monica
wrote:

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

John W. Vinson [MVP]
  #3  
Old March 29th, 2010, 12:54 AM posted to microsoft.public.access.forms
Monica
external usenet poster
 
Posts: 67
Default How to bring forward a value from previous record

Thankyou - worked a treat

"John W. Vinson" wrote:

On Sun, 21 Mar 2010 21:20:01 -0700, Monica
wrote:

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

John W. Vinson [MVP]
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.