R
Roger Lord
I'm having a strange problem involving forms that open
forms. I can only describe it as follows:
I have 3 forms (Form A, B, and C) and 2 reports.
Form A is a "main" form that opens Form B or Form C.
Form B can open a report and Form C can open a report.
Both Form B and C have listboxes that the user can select
from and then use the selection to open and fill a report
for printing.
Here's how Form A opens the other forms:
DoCmd.OpenForm "B", acNormal, , , , acDialog
Here's the problem...
If I open Form B and then close it without opening a report,
I can go on to open Form C and everything works fine.
On the other hand, if I open Form B, open a report, and then
close Form B, my attempt to open Form C results in Form B
opening again. If I close Form B after this unexpected
visit, then I can go on to Form C as before. Opening the
report is what makes things go wrong. This is also the case
if I first open Form C, open a report, close Form C, and
then try to open Form B. I re-visit Form C unexpectedly.
Here's how I close each form...
DoCmd.Close acForm, "C", acSaveNo
Here's how I open a report (for immediate print without a
preview)...
DoCmd.OpenReport "MyReport", acViewNormal
Does anybody have any idea why opening a report from either
Form B or C causes the close sequence to get messed up?
Thanks,
Roger
forms. I can only describe it as follows:
I have 3 forms (Form A, B, and C) and 2 reports.
Form A is a "main" form that opens Form B or Form C.
Form B can open a report and Form C can open a report.
Both Form B and C have listboxes that the user can select
from and then use the selection to open and fill a report
for printing.
Here's how Form A opens the other forms:
DoCmd.OpenForm "B", acNormal, , , , acDialog
Here's the problem...
If I open Form B and then close it without opening a report,
I can go on to open Form C and everything works fine.
On the other hand, if I open Form B, open a report, and then
close Form B, my attempt to open Form C results in Form B
opening again. If I close Form B after this unexpected
visit, then I can go on to Form C as before. Opening the
report is what makes things go wrong. This is also the case
if I first open Form C, open a report, close Form C, and
then try to open Form B. I re-visit Form C unexpectedly.
Here's how I close each form...
DoCmd.Close acForm, "C", acSaveNo
Here's how I open a report (for immediate print without a
preview)...
DoCmd.OpenReport "MyReport", acViewNormal
Does anybody have any idea why opening a report from either
Form B or C causes the close sequence to get messed up?
Thanks,
Roger