استخدم هذا .......
Dim x As Integer, mov_st As String
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("SELECT prodcut.id, prodcut.prodcut FROM prodcut ORDER BY prodcut.prodcut;")
rst.MoveFirst
x = 1
mov_st = rst!prodcut
Do While Not rst.EOF
If mov_st <> rst!prodcut Then
x = 1
mov_st = rst!prodcut
End If
rst.Edit
rst!id = x
x = x + 1
rst.Update
rst.MoveNext
Loop
MsgBox "تم توزيع الارقام ", vbInformation + vbMsgBoxRight + vbOKOnly, "برنامج"
rst.Close
Me.Refresh