E
Ed
I have a Main form. Each record in the main form has a number of assocated
records in a subform. I want to manually sort the subform records using a
Sort field with an integar. When I create a new subform record, I want the
default value to show the next available sort number based on the Main form
record.
Main form = frmMain (Single Form)
subform = subformDetail (Datasheet)
=updateSort() in txtSort.defaultvalue
Public Function updateSort()
updateSort = DMax("Sort", "tblDetail", "[ID] = " &
[Forms]![frmMain]![txtID]) + 1
End Function
When I create a new subform record, the default works OK. When I create a
second record the default value does not re-run the function. The sort
number is repeated.
records in a subform. I want to manually sort the subform records using a
Sort field with an integar. When I create a new subform record, I want the
default value to show the next available sort number based on the Main form
record.
Main form = frmMain (Single Form)
subform = subformDetail (Datasheet)
=updateSort() in txtSort.defaultvalue
Public Function updateSort()
updateSort = DMax("Sort", "tblDetail", "[ID] = " &
[Forms]![frmMain]![txtID]) + 1
End Function
When I create a new subform record, the default works OK. When I create a
second record the default value does not re-run the function. The sort
number is repeated.