control + apostrophe

  • Thread starter Thread starter siggy
  • Start date Start date
S

siggy

control + apostrophe will bring up the previous record's value...

I require it to be the previous value PLUS ONE....
if the previous value was 1357 ( numeric), I need field in new
record to be : 1358 ( yet still allow it to be changed..... )

and therefore, if I now enter a value of : 7531,
then the NEXT new record would default to : 7532


siggy
 
Siggy,

You can't do this with the keyboard shortcut. There would be a way to
do this with an AutoKeys macro, by defining your own keystroke
combination to enter this value. But this may work for you instead...
Just set the Default Value property of the textbox on your form to the
equivalent of this...
DMax("[TheNumberField]","YourTable")+1

Will that do what you want?
 
perfect -- thanks



Steve Schapel said:
Siggy,

You can't do this with the keyboard shortcut. There would be a way to do
this with an AutoKeys macro, by defining your own keystroke combination to
enter this value. But this may work for you instead... Just set the
Default Value property of the textbox on your form to the equivalent of
this...
DMax("[TheNumberField]","YourTable")+1

Will that do what you want?

--
Steve Schapel, Microsoft Access MVP

control + apostrophe will bring up the previous record's value...

I require it to be the previous value PLUS ONE....
if the previous value was 1357 ( numeric), I need field in new
record to be : 1358 ( yet still allow it to be changed..... )

and therefore, if I now enter a value of : 7531,
then the NEXT new record would default to : 7532


siggy
 
When you need to acquire the "next number", my preference is to acquire this
information from an autonumber field. There are a variety of things that
could "hicup" and possibly cause a duplication in numbers.

There are several posts about autonumber fields if you need more
information.

Here are just some that I believe are noteworthy:

Use Autonumbers properly
http://www.mvps.org/access/general/gen0025.htm

Have Autonumber field start from a value different from 1
http://www.mvps.org/access/tables/tbl0005.htm


--
Rob Mastrostefano

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com
 
Back
Top