I have the following code in the on click event of a commad button
I am looking to duplicate the majority of the last record using this command button(further similar lines of code not shown). The problem I am encountering is that the Field SalesID is an autonumber field and is at 23650 as a record count and the record this bit of code returns is record 110. Can someone tell me where I am going wrong with the criteria
I have tried taking out the Nz portion and also used DLast, but to no effect.
Me.ProjectID = DLookup("[ProjectID]", "tblSalesDetails", Nz(DMax("[SalesID]", "tblSalesDetails"), 0))
Many thanks in advance
Richard
I am looking to duplicate the majority of the last record using this command button(further similar lines of code not shown). The problem I am encountering is that the Field SalesID is an autonumber field and is at 23650 as a record count and the record this bit of code returns is record 110. Can someone tell me where I am going wrong with the criteria
I have tried taking out the Nz portion and also used DLast, but to no effect.
Me.ProjectID = DLookup("[ProjectID]", "tblSalesDetails", Nz(DMax("[SalesID]", "tblSalesDetails"), 0))
Many thanks in advance
Richard