event procedure problems (1 Viewer)

sullivan

Registered User.
Local time
Today, 07:34
Joined
Apr 24, 2001
Messages
48
Recently I posted a question regarding a program to force a label report to skip a specified number of labels. My problem at that time was with the IsLoaded function. That is now working. However, now that everything looks right, the program doesn't work. It goes through all the correct steps, but nothing happens. It opens the report without having skipped the specified number of labels. I'm not getting any errors, and am obviously close to clueless about programing. Does anyone see a problem with the following events? I'm sorry to list all four of them, but I can't find the problem.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If PrintCount <= Forms!frmClientLabelPosition!txtLabelsToSkip _
And mboolFirstLabel = True Then
Me.NextRecord = False
Me.PrintSection = False
Else
mboolFirstLabel = False
'PrintCount = 0
End If
End Sub

Private Sub Report_NoData(Cancel As Integer)
MsgBox "No Clients To Print"
Cancel = True
End Sub

Private Sub Report_Open(Cancel As Integer)
If Not IsLoaded("frmClientLabelPosition") Then
MsgBox "You Must Run This Report From Label Criteria Form"
Cancel = True
Else
mboolFirstLabel = True
End If
End Sub

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
mboolFirstLabel = True
End Sub
 

sullivan

Registered User.
Local time
Today, 07:34
Joined
Apr 24, 2001
Messages
48
please help

So far no one seems to know what I should do. Should I try to debug the code? Does anyone have any suggestions of how to do this or a place I can go to get help? I'm very frustrated and don't see what's wrong. Any help would be appreciated.
 

sullivan

Registered User.
Local time
Today, 07:34
Joined
Apr 24, 2001
Messages
48
I got the code to work, finally. I thought I'd let you know what I did. It's so simple, I can't believe I've been missing this the whole time. I added a general declaration that defines mboolFirstLabel:

Option Compare Database
Option Explicit
Private mboolFirstLabel As Boolean

Now everything works fine.
 

Users who are viewing this thread

Top Bottom