Hello, I have a simple delete button that deletes the main record and records pertaining to it and it works except I get this Enter Parameter Value Dialogue Box that gives the error below:
Now I found that formula on my [frm_MachineOutputSubform] which it has to do with a cascading combo box using a query [qry_DependantLengthToProduct] that the cboProductID uses and for some reason when I delete the main record it gives that error BUT still deletes the record as expected. I think it has to do with its deleting some of the info that the combo relies on and then deletes all the info after.
Here is the delete button, what needs added to supress the Dialogue? Thanks!
Thanks,
SoggyCashew.....
Code:
Enter Parameter Value
Forms!frm_ShiftDay!frm_ShiftMachinesSubform.Form!frm_MachineOutputSubform.Form!cboProductID
Now I found that formula on my [frm_MachineOutputSubform] which it has to do with a cascading combo box using a query [qry_DependantLengthToProduct] that the cboProductID uses and for some reason when I delete the main record it gives that error BUT still deletes the record as expected. I think it has to do with its deleting some of the info that the combo relies on and then deletes all the info after.
Here is the delete button, what needs added to supress the Dialogue? Thanks!
Code:
Private Sub cmdDeleteShift_Click()
'--------------------------------------------------------------------------------------------------
' Deletes entire current shift and its related records.
'--------------------------------------------------------------------------------------------------
If IsNull(Me.ShiftDayID) Then
MsgBox "There is no shift to delete!", vbInformation, "No Shift"
Exit Sub
End If
If MsgBox("Are you sure you want to delete this entire Shift?" & vbCrLf _
& "There is no way to recover these records if you say 'Yes'.", vbCritical + vbYesNo, "Confirm Deletion Of Shift") = vbYes Then
DoCmd.SetWarnings False
'Delete the record
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
'On Error Resume Next 'Ignore error if first record
'Return to the previous record
'DoCmd.GoToRecord , , acPrevious
Else
End If
End Sub
Thanks,
SoggyCashew.....