force the AutoNumber field to generate a new number

L

LisaB

I have an Access 2000 front-end connected to a SQL 2000 backend
I have a form with a subform
when a new record is created in the subform I would like to use the value in
the autonumber field to run some code
-- for example
After the user enters a value in fldGrantNum I would like to execute
the expression me.fldGrantID = "ABC" + AutoNum

THE PROBLEM
The autonumber is not generated until the record is saved/updated in SQL
When I try to force a save by using
--- DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
I get the runtime error 2046
---- The Command or Action 'SaveRecord' isn't available now

How do I force a record to be saved so that the autonumber field will
generate a new number
 

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