copy the autonumber to another text field

B

BLTibbs

Immediately after I create a new record and my autonumber is generated for
that new record, I want to copy and store the autonumber in another number
field on that record.

What would be the best way to do that?
 
O

Ofer

If the data been inserted using a form, then create a field in the form that
is bound to the field that you want to save the auto number in.
On the before insert event of the form you can write the code

Private Sub Form_BeforeInsert(Cancel As Integer)
Me.[New Field name] = Me.[Auto Number Field Name]
End Sub
 
D

Douglas J. Steele

You've got multiple threads underway right now.

I think you need to sit back and explain not only what you're trying to do,
but why you're trying to do it.

It's entirely possible that there are easier ways to achieve whatever it is
you're trying to do.
 
B

BLTibbs

Ah! Like hot coffee after working all day in the cold! Thanks so much for
your help! works like a champ. Sometimes it is so simple...

Ofer said:
If the data been inserted using a form, then create a field in the form that
is bound to the field that you want to save the auto number in.
On the before insert event of the form you can write the code

Private Sub Form_BeforeInsert(Cancel As Integer)
Me.[New Field name] = Me.[Auto Number Field Name]
End Sub
--
I hope that helped
Good luck


BLTibbs said:
Immediately after I create a new record and my autonumber is generated for
that new record, I want to copy and store the autonumber in another number
field on that record.

What would be the best way to do that?
 
O

Ofer

Your welcome, glad I could help
--
I hope that helped
Good luck


BLTibbs said:
Ah! Like hot coffee after working all day in the cold! Thanks so much for
your help! works like a champ. Sometimes it is so simple...

Ofer said:
If the data been inserted using a form, then create a field in the form that
is bound to the field that you want to save the auto number in.
On the before insert event of the form you can write the code

Private Sub Form_BeforeInsert(Cancel As Integer)
Me.[New Field name] = Me.[Auto Number Field Name]
End Sub
--
I hope that helped
Good luck


BLTibbs said:
Immediately after I create a new record and my autonumber is generated for
that new record, I want to copy and store the autonumber in another number
field on that record.

What would be the best way to do that?
 
B

BLTibbs

Douglas, Ken and Ofer

Thanks so much for your help and patience with me. I am trying to learn
this stuff so I don't have to keep coming to you guys.

Ofer gave me the solution and I am on my way.
 
Top