S
Sam
Hi - Not sure where best to post Q.
I am maintain old code. Was running in Acc2000 RT. Now need to run in
Acc2007 RT.
Acc2007 RT gives "Execution of this application has stopped due to a
run-time error"
I've pinned down the error to the below statements (lots of msgbox's) in my
If I comment out the below calls, everything works fine. BUT, the below
calls was helping to provide control over a) showing the report control form
- listing available reports;
b) and the Print/Print Preview of the report - so when I select the Close
button, the report form shows.
In Acc2007 RT, with the below stmts commented out, I have to find and select
the Print Preview Close button for the report form to show.
Is there a better way to do what I need? My goal:
1) show report form
2) select report from form and show print preview
3) select an obvious Close button (Acc2000 used to display one vs the upper
right X)
4) show the report form
TIA
Sam
=== code not liked by Access 2007 RT =====
Private Sub Form_Open(Cancel As Integer)
Dim ObjAccess As Object
Dim strPath As String
'[strPath result = full path to a reports.mdb - works fine]
'Failing Call 1
Set ObjAccess = GetObject(strPath)
Call SetForegroundWindow(ObjAccess.hWndAccessApp)
Forms!report_manager.Visible = True
End Sub
Private Sub Command32_Click()
Dim ObjAccess As Object
Dim strPath As String
'[strPath result = full path to a reports.mdb - works fine]
'Failing Call 2
Set ObjAccess = GetObject(strPath)
Call ShowWindow(ObjAccess.hWndAccessApp, SW_SHOWMAXIMIZE)
End Sub
I am maintain old code. Was running in Acc2000 RT. Now need to run in
Acc2007 RT.
Acc2007 RT gives "Execution of this application has stopped due to a
run-time error"
I've pinned down the error to the below statements (lots of msgbox's) in my
If I comment out the below calls, everything works fine. BUT, the below
calls was helping to provide control over a) showing the report control form
- listing available reports;
b) and the Print/Print Preview of the report - so when I select the Close
button, the report form shows.
In Acc2007 RT, with the below stmts commented out, I have to find and select
the Print Preview Close button for the report form to show.
Is there a better way to do what I need? My goal:
1) show report form
2) select report from form and show print preview
3) select an obvious Close button (Acc2000 used to display one vs the upper
right X)
4) show the report form
TIA
Sam
=== code not liked by Access 2007 RT =====
Private Sub Form_Open(Cancel As Integer)
Dim ObjAccess As Object
Dim strPath As String
'[strPath result = full path to a reports.mdb - works fine]
'Failing Call 1
Set ObjAccess = GetObject(strPath)
Call SetForegroundWindow(ObjAccess.hWndAccessApp)
Forms!report_manager.Visible = True
End Sub
Private Sub Command32_Click()
Dim ObjAccess As Object
Dim strPath As String
'[strPath result = full path to a reports.mdb - works fine]
'Failing Call 2
Set ObjAccess = GetObject(strPath)
Call ShowWindow(ObjAccess.hWndAccessApp, SW_SHOWMAXIMIZE)
End Sub