Barb,
Check Help for syntax assistance on the For-Else-Then statement.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull([PaymentID]) Then
[PaymentID].Visible = False
[PaymentAmt].Visible = False
[PaymentDate].Visible = False
Else
[PaymentID].Visible = True
[PaymentAmt].Visible = True
[PaymentDate].Visible = True
End If
End Sub
If you don't make Amt and Date visible again, in the Else statement,
they will never be visible again during that report printout.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in your life."
"BarbS via AccessMonster.com" <u36617@uwe> wrote in message
news:a07ebc3e9801f@uwe...
> I'm presently studying Access and having difficulty understanding building
> event codes. What I'm trying to do is suppress the printing of three
> controls in a report if they are Null. This is how I wrote the code, but
> it
> is not working. Can someone please help. Thank you,
>
> 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]) Then
> [PaymentID] , [PaymentAmt], [PaymentDate].Visible = False
>
> Else: [PaymentID].Visible = True
>
> End If
> End Sub
>
> --
> Message posted via http://www.accessmonster.com
>