I have a sub-form on a form page. There is a button on the main form that when pressed executes an append query to insert records into the sub-form using the parent ID of the current parent record. In the event there is already data populated in the sub-form I would like to prohibit users from A. either seeing the button or B. message box that indicates sub-form data has already been entered. The purpose is if someone accidentally presses the button. Here is the current Script for running the procedure.
FYI - the sub-form is based off of an existing form. Is there a way to simply ide
Code:
Private Sub InsertCustDisc_Click()
On Error GoTo Err_InsertCustDisc_Click
Dim stDocName As String
stDocName = "CC_CustDiscount_APPEND"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_InsertCustDisc_Click:
Exit Sub
Err_InsertCustDisc_Click:
MsgBox Err.Description
Resume Exit_InsertCustDisc_Click
End Sub