Hi, regarding the below code:
The above code seems to work for the first new entry but any new entires come up with a "SubComp_in_ingID" value of "0", how do I get the new cell values for "SubComp_in_ingID" in my called form to also have the "SubComp_in_ingID" value pulled from the above code?
Thank you.
Code:
Private Sub Command15_Click()
On Error GoTo Err_Command15_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "S_frmIngDecSubComp_COO"
If IsNull(DLookup("SubComp_in_ingID", "tblSubComp_COO", "SubComp_in_ingID=" & Me![SubComp_in_ingID])) Then
DoCmd.OpenForm "S_frmIngDecSubComp_COO", , , , acFormAdd
Forms!S_frmIngDecSubComp_COO.SubComp_in_ingID = Me![SubComp_in_ingID]
Else
DoCmd.OpenForm "S_frmIngDecSubComp_COO", , , "[SubComp_in_ingID]=" & Me![SubComp_in_ingID]
End If
Exit_Command15_Click:
Exit Sub
Err_Command15_Click:
If StandardErrors(Err) = False Then
MsgBox Err & ": " & Err.Description
End If
'MsgBox Err.Description
Resume Exit_Command15_Click
End Sub
The above code seems to work for the first new entry but any new entires come up with a "SubComp_in_ingID" value of "0", how do I get the new cell values for "SubComp_in_ingID" in my called form to also have the "SubComp_in_ingID" value pulled from the above code?
Thank you.