Retrieving Values from Previous Record

B

blueman

I am using Access 2002 and want to retrieve some of the values from
the previous record and use them in the same controls in the next
record by pressing a command button while still on the previous
record.

Let me add that I am not a programmer and do this in my spare time.
I've built the databases that I use in my business with macros, not
VBA, which unfortunately I don't have time to learn. Please don't
bother with a VBA answer. I won't understand it. Thanks

I'm guessing it should either be something with a of "Set Value"
action or simply running a "Sendkeys" command using the ^' (Control +
apostrophe)key stroke. Using "Set Value", I'm not sure how to
reference the previous record once the record changes other than just
using the (Control + apostrophe)key stroke. Any help would be
appreciated

Thanks
 
S

Steve Schapel

Blueman,

I am pretty sure this will do what you are asking, though I haven't
tested it...

Use a SetValue action for each applicable field, with arguments like this:
Item: [NameOfField].[DefaultValue]
Expression: [NameOfField]

(of course, replace 'NameOfField' with the actual name of your field)
 
B

blueman

Thanks Steve,

I thought of that but I'm having a hard time grasping when to run a
macro set up like that. If I run it from record A ( the record I am
currently entering data in and the record from which I want to steal
values) how will a single Set Value action reference a New Record
(record B) that hasn't been created yet, given that it's the same
field (control)? Of course this would be vise a versa if I called the
macro from a New Record that follows Record A. I hope I'm making this
clear.

Thanks Again
 
S

Steve Schapel

Blueman,

The macro needs to be run before the new record is started, as this is
when the Default Value comes into play. Therefore you can run it from
Record A. If you have one macro that has a SetValue action for each
applicable field, you could run it on the Before Update event of the form.
 

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