news:48***********************@news.optusnet.com.a u:
Sorry, I posted the previous message in haste without sufficientMuch of the code at the MVP site gave excellent results last century.
checking. I rechecked Dev's code and found that I'd omitted the second
apiShowWindow call.
So now the report opens fine, but with the built in menubar and
toolbar instead of my custom Menubar.
The custom one is there when I open the ReportLibrary.mdb directly,
but not when opened from from this code.
So I added the line:
.Reports("rCheque").MenuBar = "DPCPreview" after opening the
report.
Now I find that it still opens without the custom menubar, but if I
right click anywhere on the screen, the custom menu appears and the
built in ones vanish.
Has anyone else experienced this problem?
If I were opening a report in another db I would
(using Northwind 2007.accdb as an example)
1. Write a procedure in that db as:
Public Function OpenEmployeesPhoneBookReport()
DoCmd.OpenReport "Employee Phone Book", acViewPreview
End Function
2. Set a reference to that db from the current/home db (the db in which I
will be working);
3. Write a function in the current/home db (the db in which I will be
working) as:
Public Function OpenNorthwind2007EmployeesPhoneBookReport()
[Northwind 2007].OpenEmployeesPhoneBookReport
End Function
I can think of three advantages of this method:
1. AutoExec Macros and Startup Forms in the referenced db are not run;
2. The referenced db does not have to be closed;
3. There may be less chance of confusing the two dbs as there is when we
create a new instance of the Access application.
--
lyle fairfield