A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#ERROR Message



 
 
Thread Tools Display Modes
  #1  
Old November 28th, 2005, 08:27 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default #ERROR Message

I have code in a report text box that works great.
Just one problem, If the field or fields is missing or doesn't have data the
function will display and annoying "#Error" message. How can I just display a
blank or "N/A" Message instead. Thanks all

diff2dates("hn",CDate([rec Dte] & " " & [rec time]),CDate(Date() & " " &
Time()))
  #2  
Old November 28th, 2005, 09:11 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default #ERROR Message

Test to see if the field or fields is null

IIF(IsNull([Rec Dte]),"N/A", diff2dates("hn",CDate([rec Dte] & " " & [rec
time]),CDate(Date() & " " & Time())))

If you need to check both then
IIF(IsNull([Rec Dte]) or IsNull([rec time]), ...,...)

"bladelock" wrote in message
...
I have code in a report text box that works great.
Just one problem, If the field or fields is missing or doesn't have data
the
function will display and annoying "#Error" message. How can I just
display a
blank or "N/A" Message instead. Thanks all

diff2dates("hn",CDate([rec Dte] & " " & [rec time]),CDate(Date() & " " &
Time()))



  #3  
Old November 29th, 2005, 01:54 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default #ERROR Message

This works fine if Rec dte or Rec dte are blank, but #Error appears if no
records meet the query. How do I control the message when no records are
found for this query in the report? Thanks for your help Mr. Spencer

"John Spencer" wrote:

Test to see if the field or fields is null

IIF(IsNull([Rec Dte]),"N/A", diff2dates("hn",CDate([rec Dte] & " " & [rec
time]),CDate(Date() & " " & Time())))

If you need to check both then
IIF(IsNull([Rec Dte]) or IsNull([rec time]), ...,...)

"bladelock" wrote in message
...
I have code in a report text box that works great.
Just one problem, If the field or fields is missing or doesn't have data
the
function will display and annoying "#Error" message. How can I just
display a
blank or "N/A" Message instead. Thanks all

diff2dates("hn",CDate([rec Dte] & " " & [rec time]),CDate(Date() & " " &
Time()))




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:25 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.