copy value from field to another in same table, different record

G

Guest

I need a macro to automatically copy the value of a field from one record
into the value of another field in the next record... so, for example,
[closeamount] needs to be copied or forwarded into [openamount] for the next
day.
 
K

Ken Snell [MVP]

When is this supposed to occur? Macro will not run from a table; must run
from a form or other similar object.

Why do you want to store what appears to be redundant data?
 
G

Guest

don't have to store it - it can be calculated... it's for a "cash register"
situation. I want to take the closing amount from one day, which is
calculated with [actual]-[withdrawal] and make that closing amount the
opening amount displayed on the register form screen for the next day.

currently displayed on a form. opening, actual count and withdrawal are
saved in a table. closed amount is calculated.

having problems with how to display a field value from a previous record
while another record is current. make sense?

Ken Snell said:
When is this supposed to occur? Macro will not run from a table; must run
from a form or other similar object.

Why do you want to store what appears to be redundant data?

--

Ken Snell
<MS ACCESS MVP>

Spade said:
I need a macro to automatically copy the value of a field from one record
into the value of another field in the next record... so, for example,
[closeamount] needs to be copied or forwarded into [openamount] for the
next
day.
 
K

Ken Snell [MVP]

Yes, I understand. When will this "calculation and storage" occur? It needs
to be triggered by some action -- clicking a button on a form, for example.

Note that such calculations usually are not stored in a table, but there are
exceptions for doing so (depending upon the data design and purpose).

What is the structure of your table where these data are stored?
--

Ken Snell
<MS ACCESS MVP>



Spade said:
don't have to store it - it can be calculated... it's for a "cash
register"
situation. I want to take the closing amount from one day, which is
calculated with [actual]-[withdrawal] and make that closing amount the
opening amount displayed on the register form screen for the next day.

currently displayed on a form. opening, actual count and withdrawal are
saved in a table. closed amount is calculated.

having problems with how to display a field value from a previous record
while another record is current. make sense?

Ken Snell said:
When is this supposed to occur? Macro will not run from a table; must run
from a form or other similar object.

Why do you want to store what appears to be redundant data?

--

Ken Snell
<MS ACCESS MVP>

Spade said:
I need a macro to automatically copy the value of a field from one
record
into the value of another field in the next record... so, for example,
[closeamount] needs to be copied or forwarded into [openamount] for the
next
day.
 
G

Guest

a form. but thanks anyway. I've been humiliated enough today. I'll find
another way or skip it.

Ken Snell said:
Yes, I understand. When will this "calculation and storage" occur? It needs
to be triggered by some action -- clicking a button on a form, for example.

Note that such calculations usually are not stored in a table, but there are
exceptions for doing so (depending upon the data design and purpose).

What is the structure of your table where these data are stored?
--

Ken Snell
<MS ACCESS MVP>



Spade said:
don't have to store it - it can be calculated... it's for a "cash
register"
situation. I want to take the closing amount from one day, which is
calculated with [actual]-[withdrawal] and make that closing amount the
opening amount displayed on the register form screen for the next day.

currently displayed on a form. opening, actual count and withdrawal are
saved in a table. closed amount is calculated.

having problems with how to display a field value from a previous record
while another record is current. make sense?

Ken Snell said:
When is this supposed to occur? Macro will not run from a table; must run
from a form or other similar object.

Why do you want to store what appears to be redundant data?

--

Ken Snell
<MS ACCESS MVP>

I need a macro to automatically copy the value of a field from one
record
into the value of another field in the next record... so, for example,
[closeamount] needs to be copied or forwarded into [openamount] for the
next
day.
 
K

Ken Snell [MVP]

? the reason for my questions is to identify how to trigger the update and
how to do the update...it'll require either an update query or some
programming to "identify" the "last record" and such. This is not a trivial
thing to do if you want to automate it, especially as it's not a regular
feature for databases to do.

If you can provide the info, we can help you identify the solution.
--

Ken Snell
<MS ACCESS MVP>


Spade said:
a form. but thanks anyway. I've been humiliated enough today. I'll find
another way or skip it.

Ken Snell said:
Yes, I understand. When will this "calculation and storage" occur? It
needs
to be triggered by some action -- clicking a button on a form, for
example.

Note that such calculations usually are not stored in a table, but there
are
exceptions for doing so (depending upon the data design and purpose).

What is the structure of your table where these data are stored?
--

Ken Snell
<MS ACCESS MVP>



Spade said:
don't have to store it - it can be calculated... it's for a "cash
register"
situation. I want to take the closing amount from one day, which is
calculated with [actual]-[withdrawal] and make that closing amount the
opening amount displayed on the register form screen for the next day.

currently displayed on a form. opening, actual count and withdrawal
are
saved in a table. closed amount is calculated.

having problems with how to display a field value from a previous
record
while another record is current. make sense?

:

When is this supposed to occur? Macro will not run from a table; must
run
from a form or other similar object.

Why do you want to store what appears to be redundant data?

--

Ken Snell
<MS ACCESS MVP>

I need a macro to automatically copy the value of a field from one
record
into the value of another field in the next record... so, for
example,
[closeamount] needs to be copied or forwarded into [openamount] for
the
next
day.
 
S

Steve Schapel

Spade,

Sorry you feel humiliated by your interchange with Ken. Personally I
can't see why from reading through the thread. And I hope my comments
don't exacerbate. But just a hint for the future... You will find you
will get better quality help in newsgroups if you are able to:
- give sufficient detail to allow people who can't see your database
to understand what you are doing
- use standard terminology if at all possible
- give the names of relevant fields, objects and controls
- give specific examples
 
G

Guest

I'd like to continue this thread, if I may.

I have a query that prompts for 2 key field values (work order numbers "WO")
and displays several fields from these 2 records. The operator then reviews
and manually swaps or edits field values. I want to prompt the operator and
on YES, swap and edit the fields automatically by macro actions. If I knew
how to temporarily store field values I could probably muddle my way through
the rest.

Ken Snell said:
? the reason for my questions is to identify how to trigger the update and
how to do the update...it'll require either an update query or some
programming to "identify" the "last record" and such. This is not a trivial
thing to do if you want to automate it, especially as it's not a regular
feature for databases to do.

If you can provide the info, we can help you identify the solution.
--

Ken Snell
<MS ACCESS MVP>


Spade said:
a form. but thanks anyway. I've been humiliated enough today. I'll find
another way or skip it.

Ken Snell said:
Yes, I understand. When will this "calculation and storage" occur? It
needs
to be triggered by some action -- clicking a button on a form, for
example.

Note that such calculations usually are not stored in a table, but there
are
exceptions for doing so (depending upon the data design and purpose).

What is the structure of your table where these data are stored?
--

Ken Snell
<MS ACCESS MVP>



don't have to store it - it can be calculated... it's for a "cash
register"
situation. I want to take the closing amount from one day, which is
calculated with [actual]-[withdrawal] and make that closing amount the
opening amount displayed on the register form screen for the next day.

currently displayed on a form. opening, actual count and withdrawal
are
saved in a table. closed amount is calculated.

having problems with how to display a field value from a previous
record
while another record is current. make sense?

:

When is this supposed to occur? Macro will not run from a table; must
run
from a form or other similar object.

Why do you want to store what appears to be redundant data?

--

Ken Snell
<MS ACCESS MVP>

I need a macro to automatically copy the value of a field from one
record
into the value of another field in the next record... so, for
example,
[closeamount] needs to be copied or forwarded into [openamount] for
the
next
day.
 
S

Steve Schapel

Pianoman,

Using macros, the "temporarily store field values" could be done by the
use of unbound textboxes on the form. Use the SetValue action in the
macro to put the value from Field1 into an unbound textbox, and another
SetValue action to move that to Field2.
 
G

Guest

Use the "AfterUpdate" event on the event tab of the properties of the field.
Click Afterupdate and then click build. You can write an event procedure to
do what ever you want it to do.

Ken Snell said:
? the reason for my questions is to identify how to trigger the update and
how to do the update...it'll require either an update query or some
programming to "identify" the "last record" and such. This is not a trivial
thing to do if you want to automate it, especially as it's not a regular
feature for databases to do.

If you can provide the info, we can help you identify the solution.
--

Ken Snell
<MS ACCESS MVP>


Spade said:
a form. but thanks anyway. I've been humiliated enough today. I'll find
another way or skip it.

Ken Snell said:
Yes, I understand. When will this "calculation and storage" occur? It
needs
to be triggered by some action -- clicking a button on a form, for
example.

Note that such calculations usually are not stored in a table, but there
are
exceptions for doing so (depending upon the data design and purpose).

What is the structure of your table where these data are stored?
--

Ken Snell
<MS ACCESS MVP>



don't have to store it - it can be calculated... it's for a "cash
register"
situation. I want to take the closing amount from one day, which is
calculated with [actual]-[withdrawal] and make that closing amount the
opening amount displayed on the register form screen for the next day.

currently displayed on a form. opening, actual count and withdrawal
are
saved in a table. closed amount is calculated.

having problems with how to display a field value from a previous
record
while another record is current. make sense?

:

When is this supposed to occur? Macro will not run from a table; must
run
from a form or other similar object.

Why do you want to store what appears to be redundant data?

--

Ken Snell
<MS ACCESS MVP>

I need a macro to automatically copy the value of a field from one
record
into the value of another field in the next record... so, for
example,
[closeamount] needs to be copied or forwarded into [openamount] for
the
next
day.
 

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