I would suggest using the Button Wizard, record Operations, adding the functions you want that way, and then scavenge the code if you want to use it on your buttons. Like, add a record is:
DoCmd.GoToRecord , , acNewRec
So I think the solution is there.
I can't tell you the number of times I have had to sort out someone's application because they didn't use autonumber and there were duplicate keys. Make sure you set the field to Index Yes (No Duplicates) and do the necessary error handling.
Did that help?
__________________
mmcdonal
Look it up at: http://wrox.books24x7.com
|