M
MikeF
The following code opens a form that contains detail info on only *some* of
the records in the master form.
Would like to adjust so when I click on the button, if there's no matching
AdvID in the detail form, a MsgBox appears and states as such, instead of
opening the detail form at a new blank record.
Any assistance is greatly appreciated.
Regards,
- Mike
Private Sub btnFrmAdvSummary_Click()
On Error GoTo Err_btnFrmAdvSummary_Click
Dim strDocName As String
Dim strLinkCriteria As String
strDocName = "frmAdvSummary"
strLinkCriteria = "[AdvID] = """ & Me![AdvID] & """"
DoCmd.OpenForm strDocName, _
WhereCondition:=strLinkCriteria, _
WindowMode:=acDialog
Exit_btnFrmAdvSummary_Click:
Exit Sub
Err_btnFrmAdvSummary_Click:
MsgBox Err.Description
Resume Exit_btnFrmAdvSummary_Click
End Sub
the records in the master form.
Would like to adjust so when I click on the button, if there's no matching
AdvID in the detail form, a MsgBox appears and states as such, instead of
opening the detail form at a new blank record.
Any assistance is greatly appreciated.
Regards,
- Mike
Private Sub btnFrmAdvSummary_Click()
On Error GoTo Err_btnFrmAdvSummary_Click
Dim strDocName As String
Dim strLinkCriteria As String
strDocName = "frmAdvSummary"
strLinkCriteria = "[AdvID] = """ & Me![AdvID] & """"
DoCmd.OpenForm strDocName, _
WhereCondition:=strLinkCriteria, _
WindowMode:=acDialog
Exit_btnFrmAdvSummary_Click:
Exit Sub
Err_btnFrmAdvSummary_Click:
MsgBox Err.Description
Resume Exit_btnFrmAdvSummary_Click
End Sub