place a value in a field, derived and modified from a previous rec

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone help me to set a field up in access, which looks at the field in
thelast record, takes that value, adds 1 to it and places that modified value
in the current record. I have an idea that it may need a VB function, but
don't know any or indeed how to utilise them. Your help is appreciated!

Cheers
 
Macca

Take a look at the mvps.org/access website, or search at Google.com for
"custom Autonumber". What you describe sounds like a "sequence" number ...
but "the last record" needs definition. Access stores records in buckets,
in some internal order that may not match your definition of "last".

One approach is to use the DMax() function on a sequence number field, then
add one. This may NOT be what you meant by "last".

Good luck

Jeff Boyce
<Access MVP>
 
Jeff, thanks for your help, what I mean by last is the "last" record that I
have entered, and I guess it should contain a value in this particular field
which is 1 less than the one I want placed in the current record being
entered.

The field is for example:- StudentNumber: 20050035

How specifically do I utilise the DMAX() function?

Regards
Macca
 
Macca

Rather than conduct a tutorial on programming, how about if I point you to
the Access HELP system...

You can find DMax() syntax and examples there, as well as by reviewing the
leads in my previous response.

Good luck

Jeff Boyce
<Access MVP>
 
Back
Top