T
trekgoes2malaysia
In VBA, I want to check if a particular form or report is open and if
so, close it. I am using the code below but it is not working (Access
returns a message saying it cannot identify the form if it is not
already open). How can I get around this?
'Closing all open report files
If [Forms]![frmGraphCyclist].Open Then
[Forms]![frmGraphCyclist].Close
End If
If [Reports]![ReportCyclistEfforts].Open Then
[Reports]![ReportCyclistEfforts].Close
End If
If [Reports]![RptTeamEfforts].Open Then
[Reports]![RptTeamEfforts].Close
End If
Patrick
so, close it. I am using the code below but it is not working (Access
returns a message saying it cannot identify the form if it is not
already open). How can I get around this?
'Closing all open report files
If [Forms]![frmGraphCyclist].Open Then
[Forms]![frmGraphCyclist].Close
End If
If [Reports]![ReportCyclistEfforts].Open Then
[Reports]![ReportCyclistEfforts].Close
End If
If [Reports]![RptTeamEfforts].Open Then
[Reports]![RptTeamEfforts].Close
End If
Patrick