VBA used in Reports

AFKillbait

Registered User.
Local time
Today, 02:41
Joined
Aug 8, 2009
Messages
27
I have an If/Then statement in VBA for one of my forms, under Form_Current() that displays "Not Completed" in the due date box if the original date box is blank.

Code:
If IsNull(Me.Field) Then
        Me.Field_Due = "Not Completed"
    Else
        Me.Field_Due = DateAdd("m", 12, Me.Field)
    End If

What I need is for my reports to display the same thing, however when I try to use the same code it doesn't show anything at all, even in the first field. Is there a way to adapt the code to work with reports?
 
Just use an IIF statement in the control source of a text box on the report:

=IIF(IsNull([Field]),"Not Completed", DateAdd("m", 12, [Field]))
 
That did it, thanks... Talk about a "duh" moment.
 

Users who are viewing this thread

Back
Top Bottom