method 'Nz' of object error??

C

Crispywafers

I have a report where I didn't want certain textboxes to show if they
were equal to zero.

However, everything works fine when scrolling through the reports...
and then all of a sudden... on the same couple reports I will get the
error:

"Runtime error: Method 'Nz' of object '_Application' failed".

Can someone tell me what this means? I dont' even know where to start.


The code is:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

txtExtendedDayT.Visible = Nz(Me!txtExtendedDayT, 0) <> 0
txtEarlyBirdT.Visible = Nz(Me!txtEarlyBirdT, 0) <> 0
txtDiscountT.Visible = Nz(Me!txtDiscountT, 0) <> 0

If txtDiscountT.Visible = True Then
txtLeft.Visible = True
txtRight.Visible = True
Else
txtLeft.Visible = False
txtRight.Visible = False

End If


End Sub
 
T

Tom Wickerath

Hello Crispy,

If your implementation worked previously, and all of a sudden starts failing (or fails when you
move the database to a different PC), this usually indicates a reference marked as "MISSING".
Here are two excellent articles on the topic of missing references:

Solving Problems with Library References (Allen Browne)
http://members.iinet.net.au/~allenbrowne/ser-38.html

and

Access Reference Problems (Doug Steele)
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html


Tom
_______________________________________


I have a report where I didn't want certain textboxes to show if they
were equal to zero.

However, everything works fine when scrolling through the reports...
and then all of a sudden... on the same couple reports I will get the
error:

"Runtime error: Method 'Nz' of object '_Application' failed".

Can someone tell me what this means? I dont' even know where to start.


The code is:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

txtExtendedDayT.Visible = Nz(Me!txtExtendedDayT, 0) <> 0
txtEarlyBirdT.Visible = Nz(Me!txtEarlyBirdT, 0) <> 0
txtDiscountT.Visible = Nz(Me!txtDiscountT, 0) <> 0

If txtDiscountT.Visible = True Then
txtLeft.Visible = True
txtRight.Visible = True
Else
txtLeft.Visible = False
txtRight.Visible = False

End If


End Sub
 

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