Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / September 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Spade - 15 Mar 2005 22:09 GMT
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.
Ken Snell [MVP] - 15 Mar 2005 23:44 GMT
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?

Signature

       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.
Spade - 15 Mar 2005 23:55 GMT
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.
[quoted text clipped - 6 lines]
> > next
> > day.
Ken Snell [MVP] - 16 Mar 2005 02:19 GMT
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?
Signature


       Ken Snell
<MS ACCESS MVP>

> don't have to store it - it can be calculated...  it's for a "cash
> register"
[quoted text clipped - 19 lines]
>> > next
>> > day.
Spade - 16 Mar 2005 02:33 GMT
a form.  but thanks anyway.  I've been humiliated enough today.  I'll find
another way or skip it.

> 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.
[quoted text clipped - 26 lines]
> >> > next
> >> > day.
Ken Snell [MVP] - 16 Mar 2005 03:43 GMT
? 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.
Signature


       Ken Snell
<MS ACCESS MVP>

>a form.  but thanks anyway.  I've been humiliated enough today.  I'll find
> another way or skip it.
[quoted text clipped - 37 lines]
>> >> > next
>> >> > day.
Pianoman - 17 Dec 2005 16:42 GMT
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.

> ? 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
[quoted text clipped - 44 lines]
> >> >> > next
> >> >> > day.
Steve Schapel - 17 Dec 2005 17:19 GMT
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.

Signature

Steve Schapel, Microsoft Access MVP

> I'd like to continue this thread, if I may.
>
[quoted text clipped - 4 lines]
> how to temporarily store field values I could probably muddle my way through
> the rest.
Ellsun - 22 Sep 2006 21:14 GMT
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.

> ? 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
[quoted text clipped - 44 lines]
> >> >> > next
> >> >> > day.
Steve Schapel - 16 Mar 2005 04:26 GMT
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

Signature

Steve Schapel, Microsoft Access MVP

> a form.  but thanks anyway.  I've been humiliated enough today.  I'll find
> another way or skip it.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.