Code for the NEW button:
Code:
Private Sub cmdNew_Click()
If IsNull(Me!InspList) Then
MsgBox "Please select an item from the list"
Else
DoCmd.RunSQL "INSERT INTO TblQCertDetails ( InspectionID, CertDate ) SELECT " & Me!InspList & " AS InspectionID, Date() AS CertDate;"
Me!InspList.Requery
Me.Filter = "CertID=" & DLookup("Max(CertID)", "TblQCertDetails", "InspectionID=" & Me!InspList)
Me.FilterOn = True
Me.Requery
End If
End Sub
There is an EnteredBy field that you may want to add to this INSERT statement (in both places). Usually it is taken from the user's login - Environ("username") - but I am not sure how your design is for the users.