Why does this happen to my report

B

Bob Vance

I have a batch print report, when tbNoCreditCard is ticked, still always my
first Report shows Credit Card details.
Seems I must need a requery somewhere!....Thanks for any help..bob

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
On Error GoTo ProcError
If tbNoCreditCard = False Then



BoxC2.Visible = True
BoxC3.Visible = True
lbCreditCard.Visible = True
tbCreditCard2.Visible = True
tbCreditCard3.Visible = True
lbName.Visible = True
lbExpiry.Visible = True
lbSignature.Visible = True
Box136.Visible = True
Box137.Visible = True
Box138.Visible = True
Box139.Visible = True
Box140.Visible = True
Box142.Visible = True
Box143.Visible = True
Box144.Visible = True
Box145.Visible = True
Box146.Visible = True
Box147.Visible = True
Box148.Visible = True
Box149.Visible = True
Box150.Visible = True
Box152.Visible = True
Box153.Visible = True
Line169.Visible = True
Line191.Visible = True
Line170.Visible = True
Line196.Visible = True
BoxC2.Visible = True
BoxC3.Visible = True
lblTick.Visible = True
BoxC1.Visible = True
lblAmountpaid.Visible = True
tbCreditCard1.Visible = True

Else

BoxC2.Visible = False
BoxC3.Visible = False
lbCreditCard.Visible = False
tbCreditCard2.Visible = False
tbCreditCard3.Visible = False
lbName.Visible = False
lbExpiry.Visible = False
lbSignature.Visible = False
Box136.Visible = False
Box137.Visible = False
Box138.Visible = False
Box139.Visible = False
Box140.Visible = False
Box142.Visible = False
Box143.Visible = False
Box144.Visible = False
Box145.Visible = False
Box146.Visible = False
Box147.Visible = False
Box148.Visible = False
Box149.Visible = False
Box150.Visible = False
Box152.Visible = False
Box153.Visible = False
Line169.Visible = False
Line191.Visible = False
Line170.Visible = False
Line196.Visible = False
BoxC2.Visible = False
BoxC3.Visible = False
lblTick.Visible = False
BoxC1.Visible = False
lblAmountpaid.Visible = False
tbCreditCard1.Visible = False


ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Detail_Format..."
Resume ExitProc
End If

End Sub
 
D

Danny J. Lesandrini

Bob:

Put a STOP command just before the IF branch. At that point, check
your condition. I'm not sure what tbNoCreditCard is in this context.

Is it a variable? Is it a field in the table, a control on the report?
Is it a reference to a checkbox on a form? Whatever it is, I suspect
it's not evaluating and you need to check it in debug mode.

Put the STOP command where I've shown below, and when it stops,
press Ctl+G to bring up the Immediate window. Type this and hit Enter:

?tbNoCreditCard

The question mark instructs the debugger to print the value to the
Immediate window. This should reveal the value, if not the issue.
 
B

Bob Quintal

I have a batch print report, when tbNoCreditCard is ticked, still
always my first Report shows Credit Card details.
Seems I must need a requery somewhere!....Thanks for any help..bob

Your problem is when you call the code to hide the fields.
(PageFooterSection_Format) the report has already printed the first
record. Move the code to the detail_format and that should fix the
problem.

Q
 
B

Bob Vance

Thanks Bob, Brilliant...Bob
Bob Quintal said:
Your problem is when you call the code to hide the fields.
(PageFooterSection_Format) the report has already printed the first
record. Move the code to the detail_format and that should fix the
problem.

Q
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top