Macro to lookup last file Number and incriment by 1 in Access

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

Guest

I want Access to fill in a file number field similar to AutoNumber except
that I want to be able to change the number. I just want it to look up the
last record and incriment by 1. Then by pressing [tab] or [Enter] it will
accept the new value or I can type in a new value. I don't know if this is
best done with a macro or VBA.
 
Phil,

You don't need macro or VBA procedure for this.

On your form, set the Default Value property of your File Number
control, to the equivalent of this...
DMax("[File Number]","YourTable")+1
 
Steve,
Thanks, I am still a novice with this program and your answer is better and
much simpler than the direction I was going.

Steve Schapel said:
Phil,

You don't need macro or VBA procedure for this.

On your form, set the Default Value property of your File Number
control, to the equivalent of this...
DMax("[File Number]","YourTable")+1

--
Steve Schapel, Microsoft Access MVP

Phil said:
I want Access to fill in a file number field similar to AutoNumber except
that I want to be able to change the number. I just want it to look up the
last record and incriment by 1. Then by pressing [tab] or [Enter] it will
accept the new value or I can type in a new value. I don't know if this is
best done with a macro or VBA.
 
Back
Top