copy the autonumber to another text field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
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.
 
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?
 
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?
 
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.
 

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

Similar Threads


Back
Top