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


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.
 
Ad

Advertisements

S

Steve Schapel

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
 
Ad

Advertisements

G

Guest

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.
 

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