J
jyo_palwai
Hi,
I tried to google a lot and failed to set the focus to the report . I
am running the report from the code.
I have a main switchboard and from that I navigate to several forms.
only one of these forms is open at a time.I select the criteria from
this form and run the report. My report is running but it is hiding
behind my main switchboard.
my code looks like the follwoing
Private Sub cmdRunReport_Click()
On Error Resume Next
DoCmd.OpenReport "rptNewCalibrationCards_Dept", acViewPreview
If err = 2501 Then
err.Clear
MsgBox "There is no Data for this Department.", vbOKOnly,
"Error Message"
Else
DoCmd.close acForm, "frmCalibrationCardsCriteria_Department"
Reports!rptNewCalibrationCards_Dept.SetFocus
End If
End Sub
And this is done in access 97
Am I doing anything wrong here. Any help is really appreciated.
Thanks,
Jyothsna
I tried to google a lot and failed to set the focus to the report . I
am running the report from the code.
I have a main switchboard and from that I navigate to several forms.
only one of these forms is open at a time.I select the criteria from
this form and run the report. My report is running but it is hiding
behind my main switchboard.
my code looks like the follwoing
Private Sub cmdRunReport_Click()
On Error Resume Next
DoCmd.OpenReport "rptNewCalibrationCards_Dept", acViewPreview
If err = 2501 Then
err.Clear
MsgBox "There is no Data for this Department.", vbOKOnly,
"Error Message"
Else
DoCmd.close acForm, "frmCalibrationCardsCriteria_Department"
Reports!rptNewCalibrationCards_Dept.SetFocus
End If
End Sub
And this is done in access 97
Am I doing anything wrong here. Any help is really appreciated.
Thanks,
Jyothsna