change the command65 code to the attached.
it worked when i run it on my pc
in the long run: it is VERY important that you give ALL your controls Meaningful names (such as renaming command65 to something like cmdReorder or something like that)
you might be getting along fine for now, but consider trying to read your code and debug/upgrade it in a year or two from now - you're gonna waste hours at best trying to know which is what. and letting someone else debug it is next to impossible...
and while at it, although possible to use square brackets, it's so much easier to code (and read code) if you stick to naming conventions (like no spaces and no special characters), then the brackets arent needed
(consider the difference between "[schedule #]" and "ScheduleOrd" or "ScheduleNum")
tell me if you need more help
now that i have your mdb it'll be easier
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
|
Dim LastValue As Long
LastValue = Me![Production Schedule By JSP subform].Form![Schedule #]
With Production_Schedule_By_JSP_subform.Form.Recordset
.MoveNext
While Not .EOF
LastValue = LastValue + 1
.Edit
![Schedule #] = LastValue
.Update
.MoveNext
Wend
End With
|