How do you debug a report?

ryetee

Registered User.
Local time
Today, 01:46
Joined
Jul 30, 2013
Messages
952
I have a form that the user selects which group of data to create a report on.
He simply picks the group from a combo box and then clicks a button to print..

Now this worked yesterday (!) and has stopped working today.

The line in the code (from the event clkick on the above button) is
DoCmd.OpenReport "Group Component Parts", acPreview, , sFilter

sFilter is a where condition and has the right data in (tested on a break in the program). When you step through the line above the screen changes for a millisecond as though the report is to be produced but it hasn't.

Is there anyway I can 'step into' the report logic to see what's happening, unless of course someone know without me doing that!!
 
One thing to check for is a macro in the report's no data event.
 
One thing to check for is a macro in the report's no data event.

I check for no data in the code but there isn't an event anyway.
Funnily enough it is working again.
I do have 1 event in the detail of the report (On Format) which basically just has a comment in.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
''' abarcodeY Me, 0 ' ** inserted by ABarCode on 21/09/2011 13:43:24 **

End Sub
I stuck some nonsense code in there so I could put a break point in. It then complained about something else so I took the code out and it now works?

I'd like to know what happened as it could happen again so any thoughts are welcome!
 
..
Now this worked yesterday (!) and has stopped working today.
...
What do you exactly mean by "worked yesterday (!) and has stopped working today."?
Use a message box instead of some "nonsense code", and be aware of some events isn't triggered in "Report View".
 
What do you exactly mean by "worked yesterday (!) and has stopped working today."?
Use a message box instead of some "nonsense code", and be aware of some events isn't triggered in "Report View".

What I meant was that the report was working fine. I closed access and shut down my machine for the night and in the morning I started the machine up and restarted access and the report didn't work as per first post.

The "nonsense" code was just to give me the ability to put a break in.
After removing that code it now works again - effectively I have done nothing.

What I'm worried about is that the fault occurs again. How can I best debug reports if it does?
 
Maybe it was unclear what I asked for, but what did it do as it "stopped working"?
Didn't the report show any data, didn't it open, did it show a error message or ...?
 
Maybe it was unclear what I asked for, but what did it do as it "stopped working"?
Didn't the report show any data, didn't it open, did it show a error message or ...?

The report worked and was produced (displayed) on day 1 but not displayed on day 2 -as per above "the screen changes for a millisecond as though the report is to be produced but it hasn't."
 
Last edited:
This has happened again on a different report that was working before. In design mode if I try to go to print mode I get various errors but the final one is probably the pertinent one.

A custom macro in this report has failed to run and is preventing this report from rendering.

I didn't know I had a custom macro!! I'm using barcode software (Tbarcode10) which may have put some custom macro in but I can't find it.

There is an "on format " event procedure which is basically
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
''' abarcodeY Me, 0 ' ** inserted by ABarCode on 21/09/2011 13:43:24 **

End Sub

This is where I put some 'nonesense code' and when I took it out it eventually worked again. I'm going to do that but it's obviously not the right thing to do ....or is it?
 

Users who are viewing this thread

Back
Top Bottom