Hi again,
I am working with this code from UtterAngel and came to a snag.
We create reports that list parts for towers based on sections, so "section 1" will have a list of parts "section 2" will have a list of parts and so on up to 10 sections. Also not all sections are used but only those chosen from a dropdown listing those sections.
So my Forms setup is such:
Forms!ViewProjects!frmProjSections.Form!frmProjSectPartDetail.Form!cboPart.Reque
ry (sample code for updating)
What is happening is that when I add a new section the autonumber does not start back at 10 but continues from the previous section.
Now you ask, why do I need this?
Well, it often happens that a part/s needs to be added and this of course changes the sort, so with the use of incrementing by 10 I can add a part at 11, or 12 and it will stay where I want it.
Private Sub Form_Current()
If Me.NewRecord Then
On Error Resume Next 'It should never occur, just to be sure...
Me!PartSortID.DefaultValue = Nz(DMax("[PartSortID]", "tblParts"), 0) + 10
End If
End Sub
Any suggestions to reset to 10 when a new section is added?
Bill