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_Revised Date],"mmm m 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.
I have to following in a text box in a report in Access 2003:
="Revised Date" & " " & Format([crpProduct_Revised
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>>>>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_Revis edDate) Then
Me.MyTxtBox.Visible = False
Else
Me.MyTxtBox.Visible = True
End If
End Sub
ET
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_Revis
Me.MyTxtBox.Visible = False
Else
Me.MyTxtBox.Visible = True
End If
End Sub
ET
if IsNull(crpProduct_RevisedD
xx= ="Revised Date" & " " & Format([crpProduct_Revised
else
msgbox "Isnull"
end if