S
Santiago Gomez
I am duplicating a record. I want to get at the AutoNumber ID for the new
record. How can I do it?
Set rs = Me.RecordsetClone()
rs.AddNew
rs!PrimaryBusID = PrimaryBusID
rs!FeederID = FeederID
rs!SecondaryBusID = SecondaryBusID
rs!SubBus1ID = SubBus1ID
rs!SubBus2ID = SubBus2ID
rs!SubBus3ID = SubBus3ID
rs!SubBus4ID = SubBus4ID
rs!Load = Load
rs![Notes #2] = [Notes #2]
rs![Notes #1] = [Notes #1]
rs![Connected HP] = [Connected HP]
rs![Efficiency] = [Efficiency]
rs![PF] = [PF]
rs![Load Factor] = [Load Factor]
rs![Percent Runtime] = [Percent Runtime]
rs![On/Off] = [On/Off]
rs.Update
Debug.Print rs!FeederloadID
the last line print the id of the original record, not the new autonumber.
thanks
record. How can I do it?
Set rs = Me.RecordsetClone()
rs.AddNew
rs!PrimaryBusID = PrimaryBusID
rs!FeederID = FeederID
rs!SecondaryBusID = SecondaryBusID
rs!SubBus1ID = SubBus1ID
rs!SubBus2ID = SubBus2ID
rs!SubBus3ID = SubBus3ID
rs!SubBus4ID = SubBus4ID
rs!Load = Load
rs![Notes #2] = [Notes #2]
rs![Notes #1] = [Notes #1]
rs![Connected HP] = [Connected HP]
rs![Efficiency] = [Efficiency]
rs![PF] = [PF]
rs![Load Factor] = [Load Factor]
rs![Percent Runtime] = [Percent Runtime]
rs![On/Off] = [On/Off]
rs.Update
Debug.Print rs!FeederloadID
the last line print the id of the original record, not the new autonumber.
thanks