Copy Input Data automatically to the next field (1 Viewer)

access2010

Registered User.
Local time
Today, 10:47
Joined
Dec 26, 2009
Messages
1,021
In access 2003 we would like to copy the value that has been entered into the field = Stop_Current = automatically copied into the field
= Fair_Value when the cursor moves to that field.

Your suggestion is appreciated.

Thank you, Nicole
 

Attachments

  • Copy_Data_2_Other_Field=273.mdb
    336 KB · Views: 76

XPS35

Active member
Local time
Today, 19:47
Joined
Jul 19, 2022
Messages
159
Use the after update event on Stop_Current:
me.Fair_Value = me.Stop_Current
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:47
Joined
Feb 28, 2001
Messages
27,192
Think this through before you do that.

Under what circumstances do you want to do this? When the record is a NEW record? Or every time someone changes the contents of Stop_Current? Or every time Fair_Value is zero? Or every time that you tab through the field? Or something else?

Each one of those is a different situation and requires different VBA treatment. More carefully specify what you want.
 

June7

AWF VIP
Local time
Today, 09:47
Joined
Mar 9, 2014
Messages
5,475
Why would two fields have the same data?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:47
Joined
Feb 28, 2001
Messages
27,192
@June7 - it makes sense for dates.

For a "New" record, let's say you were setting up two dates, one of which was permanent but the second wasn't. Like when something starts and then something updates - but of course for a NEW record both dates would be the same initially.

Granted, that is a hypothetical case and might not apply to the case in the OP's question. But initial and subsequent data would make sense to me.
 

June7

AWF VIP
Local time
Today, 09:47
Joined
Mar 9, 2014
Messages
5,475
That could be circumstance for any data. These fields happen to be Currency type.

So maybe:

If Me.NewRecord Then Me!Fair_Value = Me!Stop_Current

Should Fair_Value be locked against user edit?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:47
Joined
Feb 28, 2001
Messages
27,192
@June7 - That "locked" question is for the OP to decide and depends on what the app is supposed to do. Which at the moment we don't know.
 

June7

AWF VIP
Local time
Today, 09:47
Joined
Mar 9, 2014
Messages
5,475
Certainly it's for the OP to decide. Guess I assumed would be understood question was intended for the OP.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 13:47
Joined
Feb 19, 2002
Messages
43,296
It makes sense for the fair value to be equal to the current price when the record is created. After that, they would change independently. @June7 supplied code for that.
 

access2010

Registered User.
Local time
Today, 10:47
Joined
Dec 26, 2009
Messages
1,021
THANK YOU ALL,, for your suggestions.

We had two tables and our boss wanted the same information in both tables.
After a discussion, we have replicated the required fields in her required table and deleted them from the data entry table and now we do not have to copy the data as it will be entered directly into her required table.

Nicole
 

access2010

Registered User.
Local time
Today, 10:47
Joined
Dec 26, 2009
Messages
1,021
Think this through before you do that.

Under what circumstances do you want to do this? When the record is a NEW record? Or every time someone changes the contents of Stop_Current? Or every time Fair_Value is zero? Or every time that you tab through the field? Or something else?

Each one of those is a different situation and requires different VBA treatment. More carefully specify what you want.
Thank you for trying to help, sorry that my reply is late as I was sick.
 

Users who are viewing this thread

Top Bottom