OK venus,
I think it's time you dropped back to the beginning and bought a VBA book.
You need to do some studying before you try to tackle code for a production
database project.
I'd recommend "Beginning Access 2002 VBA" from Wrox publishing. (See Amazon
or your favorite book source.)
My comment, "...should be able to paste and use this code with no
problems..." meant *exactly* what it said. I had fully tested this code and
it worked perfectly.
The *ONLY* things you might have needed to do were:
1 - Change "myRecordNo" to your actual field name
2 - Change "zztblSuppliers" to your actual table name.
I don't know what you were thinking, but the code you posted below looks
nothing like the code I sent to you.
After looking at my post, the only potential problem was in the line:
MsgBox "There was a problem looking up the last used employee number",
vbCritical, "Employee Number Error"
This is a single line that was wrapped by the email program.
Anyone with a few minutes of reading a VBA book should have been able to
figure this out.
I am very sorry if this sounds a little harsh, but you need to spend some
time with a book and learn the basics, use code that is send to you without
screwing with it, or stop using code.
Start over with the code I sent you and do *NOT* change anything except the
two things I mentioned above above.
I spent a lot of time making sure this code worked and it is *very*
upsetting to see it mangled like this.
Sco
M.L. "Sco" Scofield, Microsoft Access MVP, MCSD, MCP, MSS, A+
Useful Metric Conversion #17 of 19: 1 billion billion picolos = 1 gigolo
Miscellaneous Access and VB "stuff" at
www.ScoBiz.com
venus as a boy said:
hello
I played with your code a little, eg my primary is "New ID" and
changing/deleting other little stuff I saw didn't match (but was probably
important) the format of my other code.