Link to home
Start Free TrialLog in
Avatar of sabrina_spillane
sabrina_spillane

asked on

Access 2003 Syntax for empty text box?

Hi All,
I have to following in a text box in a report in Access 2003:

="Revised Date" & " " & Format([crpProduct_RevisedDate],"mmmm dd"", ""yyyy")

What I want to be able to do though is if this date values is empty don't show the text box on the report other wise if it does contain a date show its value. I was wondering if there is syntax like an if statement i can put in the control source to do this or do I have to set visible and not visible for the text box in the code behind the report?
Which is the best way? I would prefer to do it in the control source but not too sure of the syntax. In the code behind i have something similar done already.
Thanks again in advance for all the help.
Avatar of rockiroads
rockiroads
Flag of United States of America image

U can use IsNull

if IsNull(crpProduct_RevisedDate)=False then
  xx= ="Revised Date" & " " & Format([crpProduct_RevisedDate],"mmmm dd"", ""yyyy")
else
  msgbox "Isnull"
end if
ASKER CERTIFIED SOLUTION
Avatar of Data-Man
Data-Man
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>>>>What I want to be able to do though is if this date values is empty don't show the text box on the report <<<<

Assuming your text box is located in the Detail section of your report you can use the OnFormat event of the Detail section as follows ...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  If IsNull(Me.crpProduct_RevisedDate) Then
      Me.MyTxtBox.Visible = False
  Else
      Me.MyTxtBox.Visible = True
  End If
End Sub

ET