Please help with incrementing field

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

Guest

I am using the following code to increment the ID field by one:
Dim v_Max As String
v_Max = Format(DMax("ID", "tblkpGendertst") + 1, "000")
Me.ID = v_Max
the code is in the ID after update event. The code works if the user is
entering the data manually one at the time. However, when the user pastes
multiple records on the form, which is a datasheet view, the code assigns the
same ID without incrementing. I need help! how can I have the code increment
in the scenario of copy and paste. It is important to give the user the
capability to copy and paste. please help.
thanks
Al
 
You could set the ID field in tblkpGendertst to be an autonumber instead of
just a plain number. That way every record added to the table gets an
incremental value no matter how they are added.

TomU
 
Back
Top