Solved

Access 2003 Syntax for empty text box?

Posted on 2006-07-11
4
426 Views
Last Modified: 2012-08-14
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.
0
Comment
Question by:sabrina_spillane
  • 2
4 Comments
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
U can use IsNull

if IsNull(crpProduct_RevisedDate)=False then
  xx= ="Revised Date" & " " & Format([crpProduct_RevisedDate],"mmmm dd"", ""yyyy")
else
  msgbox "Isnull"
end if
0
 
LVL 18

Accepted Solution

by:
Data-Man earned 150 total points
Comment Utility
How about this

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


HTH,
Mike
0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 100 total points
Comment Utility
If u want this in the control source, u can do this

IIF(IsNull(crpProduct_RevisedDate),'',="Revised Date" & " " & Format([crpProduct_RevisedDate],"mmmm dd"", ""yyyy"))
0
 
LVL 19

Expert Comment

by:Eric Sherman
Comment Utility
>>>>>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
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now