Hi,
I have developed a small database to hold contracts information. There is a main form named 'Contracts' which has several tabs. One of the Tabs is named 'Documentation' and it contains a subform (named Documentation SubForm) to hold all the documentation associated with a contract - the number of records in the subform varies between contracts.
At present the autonumber on the subform simply increments each time a new document is added. I would like to start the document auto numbering from '1' for each contract.
I have tried the before update event with:
Me.DocInc =Nz(DMax("[DocInc]","[tblDocumentation]","[DocID] = " & Forms!Contracts!DocInc),0)+1
but there seems to be something wrong with the way I am naming the controls on the subform
Any Ideas?
Regards
Pete
I have developed a small database to hold contracts information. There is a main form named 'Contracts' which has several tabs. One of the Tabs is named 'Documentation' and it contains a subform (named Documentation SubForm) to hold all the documentation associated with a contract - the number of records in the subform varies between contracts.
At present the autonumber on the subform simply increments each time a new document is added. I would like to start the document auto numbering from '1' for each contract.
I have tried the before update event with:
Me.DocInc =Nz(DMax("[DocInc]","[tblDocumentation]","[DocID] = " & Forms!Contracts!DocInc),0)+1
but there seems to be something wrong with the way I am naming the controls on the subform
Any Ideas?
Regards
Pete