?
Solved

Getting #Error on a report field

Posted on 2014-11-21
3
Medium Priority
?
190 Views
Last Modified: 2014-11-26
I have this control source for a field on a report but I'm getting #Error in the field if txtStandardWidthInInches is empty.

=IIf([txtStandardWidthInInches]="","",(CInt([txtStandardWidthInInches]/12) & "' " & [txtStandardWidthInInches] Mod 12 & """"))

How can I get rid of the #Error ?
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40457688
try

=IIf(IsNull([txtStandardWidthInInches]),"",(CInt([txtStandardWidthInInches]/12) & "' " & [txtStandardWidthInInches] Mod 12 & """"))

or

=IIf(nz([txtStandardWidthInInches],"")="","",(CInt([txtStandardWidthInInches]/12) & "' " & [txtStandardWidthInInches] Mod 12 & """"))
0
 

Author Comment

by:SteveL13
ID: 40457700
This did it...

=IIf(IsNull([txtStandardWidthInInches]),"",(CInt([txtStandardWidthInInches]/12) & "' " & [txtStandardWidthInInches] Mod 12 & """"))

Thanks!
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 40457833
Better yet - for a Report, create that field in the Query, instead of forcing Access to do that calculation in the report:

SELECT Col1, Col2, Nz(YourWidthColumn,0) / 12 & "' " & Nz(YourWidthColumn,0) MOD 12 & """ AS MyNewWidthColum FROM SomeTAble

Your query will not contain a column named "MyNewWidthColumn", and you can drop it directly on the report.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

770 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