Hi
I currently have a main form (frmStandResults) and 2 subforms within tab controls.
There are 2 combo boxes (Contractors and Groups) in the main form header that when updated (AfterUpdate) they requery 2 subforms that are on different tabs using the below code:
Forms!frmStandResults!sfrmStandResults.Form.Requery
Forms!frmStandResults!sfrmStandResultsMissing.Form.Requery
What I would like to be able to do is display a MsgBox if no records are returned. The MsgBox should be displayed when:
a) The combo box is updated and the tab that is currently being displayed returns no records.
b) I switch onto the other tab and there are no records displayed.
I cannot get a) to work at all. b) I used the following code OnChange and OnClick on the tab.
If Forms!frmStandResults!sfrmStandResultsMissing.Form.RecordsetClone.RecordCount = 0 Then
MsgBox "No records found"
End If
OnClick doesnt work. OnChange works but the message box appears if I switch to the other tab what has records visible.
Any suggestions on the change in code and the suitable event to place this in?
I currently have a main form (frmStandResults) and 2 subforms within tab controls.
There are 2 combo boxes (Contractors and Groups) in the main form header that when updated (AfterUpdate) they requery 2 subforms that are on different tabs using the below code:
Forms!frmStandResults!sfrmStandResults.Form.Requery
Forms!frmStandResults!sfrmStandResultsMissing.Form.Requery
What I would like to be able to do is display a MsgBox if no records are returned. The MsgBox should be displayed when:
a) The combo box is updated and the tab that is currently being displayed returns no records.
b) I switch onto the other tab and there are no records displayed.
I cannot get a) to work at all. b) I used the following code OnChange and OnClick on the tab.
If Forms!frmStandResults!sfrmStandResultsMissing.Form.RecordsetClone.RecordCount = 0 Then
MsgBox "No records found"
End If
OnClick doesnt work. OnChange works but the message box appears if I switch to the other tab what has records visible.
Any suggestions on the change in code and the suitable event to place this in?