View Single Post
  #7  
Old December 13th, 2009, 07:48 PM posted to microsoft.public.access.gettingstarted
BarbS via AccessMonster.com
external usenet poster
 
Posts: 11
Default If-Then-Else statements

Thank you and the others for helping me try and figure this out.
Obviously I 'm just learning the code, but I've tried all suggestions to no
avail. Maybe I'm not clearly saying what I need to do. I need to suppress
the printing of three controls in a report when the PaymentID control value
is null. The three controls are as you have listed below, PaymentID,
PaymentAmt, and PaymentDate. I'm entering this code in the Report Detail
section, Event, On Format and the three commands and their labels are still
showing on the report (null). Do you have any ideas of what I might be doing
wrong? Again, thank you for your help,

Daniel Pineault wrote:
How about:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'Suppress the printing of the Payment Information when the PaymentID
control value is null'
If IsNull([PaymentID]) = True Then
Me.PaymentID.Visible = False
Me.PaymentAmt.Visible = False
Me.PaymentDate.Visible = False
Else
Me.PaymentID.Visible = True
Me.PaymentAmt.Visible = True
Me.PaymentDate.Visible = True
End If
End Sub

I'm presently studying Access and having difficulty understanding building
event codes. What I'm trying to do is suppress the printing of three

[quoted text clipped - 11 lines]
End If
End Sub


--
Message posted via http://www.accessmonster.com