I have a form "fApprovalPreLoad" with two Combo Boxes, "CBEmployee" and "CBDate". These two Combo Boxes are used to filter another form with several subforms. The code below works great and filters everything fine unless the comboniation of CBEmployee and CBDate returns no results. If no results are returned I get the error message "You entered an expression that has an invalid reference to the property Form/Report".
CardLink = "[StatementDate]= #" & Forms!fApprovalPreload!CBDate.Value & "# AND [Name] = '" & Forms!fApprovalPreload!CBEmployee.Column(3) & "'"
ReimPayLink = "[StatementDate]= #" & Forms!fApprovalPreload!CBDate.Value & "# AND [EmpID] = '" & Forms!fApprovalPreload!CBEmployee.Value & "'"
fMGRCardCharges.Form.Filter = CardLink
fMGRPayments.Form.FilterOn = True
fMGRExpReimb.Form.Filter = ReimPayLink
fMGRExpReimb.Form.FilterOn = True
fMGRMileReimb.Form.Filter = ReimPayLink
fMGRMileReimb.Form.FilterOn = True
fMGRPayments.Form.Filter = ReimPayLink
fMGRPayments.Form.FilterOn = True
Because there are several subforms on the parent form, I can't simply pop-up a message saying there are no recordsl, as they may need to use other functions on the parent form.
Any help is greatly appreciated.
CardLink = "[StatementDate]= #" & Forms!fApprovalPreload!CBDate.Value & "# AND [Name] = '" & Forms!fApprovalPreload!CBEmployee.Column(3) & "'"
ReimPayLink = "[StatementDate]= #" & Forms!fApprovalPreload!CBDate.Value & "# AND [EmpID] = '" & Forms!fApprovalPreload!CBEmployee.Value & "'"
fMGRCardCharges.Form.Filter = CardLink
fMGRPayments.Form.FilterOn = True
fMGRExpReimb.Form.Filter = ReimPayLink
fMGRExpReimb.Form.FilterOn = True
fMGRMileReimb.Form.Filter = ReimPayLink
fMGRMileReimb.Form.FilterOn = True
fMGRPayments.Form.Filter = ReimPayLink
fMGRPayments.Form.FilterOn = True
Because there are several subforms on the parent form, I can't simply pop-up a message saying there are no recordsl, as they may need to use other functions on the parent form.
Any help is greatly appreciated.