Report hangs sometimes Access 2003

doublet

New member
Local time
Tomorrow, 05:38
Joined
Apr 21, 2007
Messages
2
Hi all,

I have written a report that is driven by a dialog where the user can pick any number of options to show on the report, and one option causes VB to change one of the Headers' control source and make it visible.

One particular selection causes Access to hang - I get the message
"formatting page, press ctrl+Break to stop", and of course ctrl+Break doesn't work, only thing that does is ctrl+Alt+Delete and end process!

Anyone have any ideas as to how I can see what is going on? It is not my code that clags - I have debugged the thing, and it gets all the way through the OnOpen routine just fine, and every other combination is ok, even when the same piece of code is run.

The database is only little, only about 200 records would be returned, and I have left it for a period of time (about 15 mins) just in case it is just slow.

I have already googled this, and only hits I got were people asking the same question two and four years ago, and nobody replied to them!

The filter on the report is the same as another time where the report runs fine, but in this instance, the header is fiddled with.

In another instance, the header is fiddled with in the same way, but the filter has more criteria... bit hard without showing the entire database and report, but I can paste the header code in...

Private Sub Report_Open(Cancel As Integer)
.
.
.
If Len(strFilter) > 0 Then
If MId(strFilter, 1, 5) = " AND " Then
strFilter = Right(strFilter, Len(strFilter) - 5)
End If
'(strFilter at this point reads: "MACtive=true and cactive=true and cvetab=true and cnrt=true")

Me.Filter = strFilter
Me.FilterOn = True
Else
Me.FilterOn = False
End If
Me.Caption = strRptTitle
Me.lblRptTitle.Caption = strRptTitle

'Show Headers if applicable
'0 CActive
'1 MActive
'2 CCName
'3 CNumber
'this is ok
If Not bUStatus Then
Me.GroupHeader1.Visible = False
End If
'this is ok
If Not bQStatus Then
Me.GroupHeader0.Visible = False
End If
If bCat Then
'this is ok
Me.GroupLevel(2).ControlSource = "CNumber"
Me.GroupHeader2.Visible = False
Else
'this is the problem child, but only sometimes
Me.GroupLevel(2).ControlSource = "CCName"
Me.GroupHeader2.Visible = True
End If
End sub

Any suggestions would be appreciated! I have compacted the db to see if this helps, but no...
 
BOOM BOOM!!!!

It just came to me (after some help from some friends in another forum), and just when I was about to chuck it in for the night and go to bed...

There is a calculated field in one of the headers of the report that has a lot of nulls in it...

Header was grouped on "Each Value" - I changed it to "Interval" and made interval the size of the field it was grouping on. Hey Presto, and report now works.

Surreal part of it was when I went back into the report to see exactly what I did to tell you here, it wasn't the header I thought I had changed (the one with the calculated field in it), but it is on the first group header - don't know if Access did this or if I am too tired! But it works now.

And I have learnt about nulls in header of reports... don't group on them! :-)

case closed! :D
 

Users who are viewing this thread

Back
Top Bottom