Hope someone can help me.
I've done this a million times but for some reason, it's not working. My code:
*************************************************
Private Sub cmdOK_Click()
If DCount("*", "qryRptAppsPerDept"
= 0 Then
MsgBox "No data to report", vbInformation, "REPORT"
Else
DoCmd.OpenReport "rptAppsPerDept", acViewPreview
DoCmd.Close acForm, "frmReportMenu"
End If
End Sub
*************************************************
The report is generated but the focus gets set back to my main screen. Why is this happening? This is the exact code I've used before and I've never had this problem. Note, my main screen is a form with a subform on it.
Thanks.
missyu
I've done this a million times but for some reason, it's not working. My code:
*************************************************
Private Sub cmdOK_Click()
If DCount("*", "qryRptAppsPerDept"
MsgBox "No data to report", vbInformation, "REPORT"
Else
DoCmd.OpenReport "rptAppsPerDept", acViewPreview
DoCmd.Close acForm, "frmReportMenu"
End If
End Sub
*************************************************
The report is generated but the focus gets set back to my main screen. Why is this happening? This is the exact code I've used before and I've never had this problem. Note, my main screen is a form with a subform on it.
Thanks.
missyu