View Full Version : Report won't stay open


RexesOperator
06-24-2008, 01:09 PM
I've seen this happen once before, but I don't know how to fix it - my report won't stay open. I'm calling it from the database window - not a macro. How do I get it to stay open?

I am using Access 2003

boblarson
06-24-2008, 01:15 PM
What code is on the report itself? It shows HAS MODULE - YES so there is possibly something there causing a problem.

RexesOperator
06-24-2008, 01:24 PM
Thanks for the quick reply. This is the only code that shows up in the VBA window:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(txt_EXT) Then Me.lbl_EXT.Visible = False
End Sub

georgedwilkinson
06-24-2008, 01:24 PM
I've seen this happen once before, but I don't know how to fix it - my report won't stay open. I'm calling it from the database window - not a macro. How do I get it to stay open?


In design view on the properties, are there any events firing?

Also, are you double-clicking, selecting Print, selecting Print Preview? Or what?

RexesOperator
06-24-2008, 01:27 PM
No there are no events firing. I am using a parameter query that just asks for a file number.

MSAccessRookie
06-24-2008, 01:42 PM
I have seen something like this happen when a report depended on the value in a control contained in a form that was not opened. Under normal operation, that report was spawned from the form in question, so there was no problem. From the Database Window, however, it would not run because the form was not open.

RexesOperator
06-24-2008, 01:48 PM
That makes sense, but this report is not based on information or called from a form - at least not yet.

If I can't get it working again I will (reluctantly) rebuild it.

boblarson
06-24-2008, 02:21 PM
any chance of posting it?

RexesOperator
06-24-2008, 02:25 PM
Sure - I will do it when I get home this evening. It will be around 9 PM eastern.

RexesOperator
06-24-2008, 04:54 PM
Here's a stripped version.

One thing I did notice, the Access version I have at home and the office is Access 2003. But when I open this file, it says it is using Access 2000 file format. I did check to verify I am using Access 2003 at home. I left my notebook at the office, so I will have to wait until tomorrow to see if that's part of the problem

pbaldy
06-24-2008, 05:23 PM
I get an invalid procedure call or argument on that code (in fact anything in the format event). I'm not sure why offhand, but if you take out the code the report opens fine. I'm about to sit down to dinner so can't look further right now, but perhaps you can use Conditional Formatting to accomplish that goal (and I don't see those fields/controls as being valid anyway).

RexesOperator
06-24-2008, 05:38 PM
You're right about taking out the code (nice to track down the problem), but why wouldn't the report open? And why would the code affect the report's ability to open?

Dinner is more important than Access??

Nice to know the forum still solves most problems I throw at it!

Once again (you must get tired of hearing this). Thanks for figuring it out!

boblarson
06-24-2008, 05:52 PM
Yep, as I originally suspected...rogue code :D

RexesOperator
06-24-2008, 06:00 PM
Aaah the arcane mysteries of Access!

pbaldy
06-24-2008, 06:55 PM
Dinner is more important than Access??

Dinner? No. Wife? Yes. And now I have a half-bottle of Cabernet in me, so don't expect anything meaningful out of me! :p

boblarson
06-24-2008, 07:34 PM
And now I have a half-bottle of Cabernet in me
Ah, so THAT explains those wacky late-evening posts :D

RexesOperator
06-25-2008, 07:10 AM
And now I have a half-bottle of Cabernet in me, so don't expect anything meaningful out of me! :p

You mean you need a full bottle to get anything meaningful?

pbaldy
06-25-2008, 08:14 AM
Ah, so THAT explains those wacky late-evening posts :D

Wacky?!? Who you calling wacky? Oh all right, guilty as charged. :p

You mean you need a full bottle to get anything meaningful?

LOL! I probably think I'm meaningful after a full bottle, but those around me might disagree. Actually, if I drank a full bottle I'd probably be unconscious, which is when many might say I'm at my best!

wiklendt
06-25-2008, 02:51 PM
so what was the bit of code once removed fixed the problem? i want to know!! maybe we can all figure out why it was bad for the report?

georgedwilkinson
06-25-2008, 03:31 PM
so what was the bit of code once removed fixed the problem? i want to know!! maybe we can all figure out why it was bad for the report?

The only code I saw was in post 3. I couldn't figure it out but I didn't spend much time on it.

wiklendt
06-25-2008, 03:41 PM
oops, yes, so i see... thanks george. i may have a look at the db file and see what might be up - curious isn't it? sounds like fun! :-D

RossWindows
07-24-2008, 12:17 PM
Just FYI, I've seen the same thing happen before. When opening or tryng to create a report, Access just crashed. After a lot of searching on google I found that sometimes it is due to unsupported printer drivers!

You might have to select a different printer as your default.
When this happens to me, I use "PDF Creator" as my default printer and then it works.

wiklendt
07-24-2008, 05:36 PM
wow, i completely forgot about this... unfortunately i don't have time now!! work has recognised my access ability and have been put to work normalising their databases and creating forms etc...! what a task!! i'm doing ok with it tho... *phew*