p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access VBA (http://p2p.wrox.com/forumdisplay.php?f=80)
-   -   copy previous field value (http://p2p.wrox.com/showthread.php?t=1155)

VBAHole22 July 1st, 2003 03:53 PM

copy previous field value
I have an Access project that is based on a SQL Server2k db.
The main thrust of the Access front end is a single data entry form. I would like the user to be able to copy the value in a field using the value entered in that field in the previous record. In an access .mdb this is done using the control-' key combination. But this doesn't work in an access project.
Any suggestions how I can add this functionality? I would even be willing to try a wild workaround because this is an important user requirement.

Braxis August 8th, 2003 07:21 AM

Set up some module level variables - one for each field on the form.

Whenever a record is saved, write the value of the fields to these variables.

Create an AutoKeys macro and set up the <ctrl>- shortcut in it.

Write a function that can be run from this macro. This function will check which control currently has the focus and then copy the data from the correct variable.

Brian Skelton
Braxis Computer Services Ltd.

All times are GMT -4. The time now is 07:46 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.