Zigzag
Registered User.
- Local time
- Today, 10:11
- Joined
- Aug 19, 2007
- Messages
- 386
After inserting a record into a table that has an Auto number I retrieve it using the Dlast(field,table)
Is Dlast(field,table) infallible in the way that I am using it in the code below and is there a better way?
Any help would be appreciated.
Garry
Is Dlast(field,table) infallible in the way that I am using it in the code below and is there a better way?
Code:
ssql = ("INSERT INTO ARF ([requisitioner],[Department Rqd],[FaultCode],[FaultPhrase],[Priority],[Request],[status],[ARF Raise Time],[Plant Number],[Drop Dead Time])" & _
"values ('SentinelUK PM Schedule',[Forms]![PM Schedule Due]![PMDepartment],'PM','Planned Maintenance','4 - PM',[Forms]![PM Schedule Due]![PMRequest],'Job Open',now(),[Forms]![PM Schedule Due]![ProgressPlantNo],[Forms]![PM Schedule Due]![DueDate]) ;")
DoCmd.RunSQL ssql
Mynewautonumber = DLast("arfid", "arf")
Any help would be appreciated.
Garry