Solved

Access report #Error in text field

Posted on 2014-03-12
11
1,396 Views
Last Modified: 2014-04-06
system; win7pro, access 2010 split database. Note that this works fine in Win XP.

A text field on the report shows #Error in his field after being populated. All other fields populate properly. This is an unbound field that is populated from a function in a query. The query part is "removecrlf(Jobs.notes) as NotesClear" The report form field is populated with "NotesClear"

the function "removecrlf(Jobs.notes)" is a triple replace function:
replace(replace(replace(data,"i",""), chr(13), ""), chr(10), " ")
0
Comment
Question by:jsgould
  • 6
  • 4
11 Comments
 
LVL 7

Accepted Solution

by:
COACHMAN99 earned 400 total points
ID: 39924967
SEEMS TO WORK OK FOR ME (IF DATA IS A TEXT BOX)
did you try breaking it into three separate lines in you func?
0
 

Author Comment

by:jsgould
ID: 39924995
data  is a variable in the function call which is driven by a access table field named notes which is a memo field.

I just noticed a possibility, the control/text box name is the same as the record source "NotesClear". perhaps you could try that and see if its still ok. tks
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39925008
I don't have the database set up etc but suggest testing a 3-line function first, without embedding in sql. Alternatively, change your sql 'as' part.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:jsgould
ID: 39925037
Tks. I'm going to the client tomorrow or Friday to try just that. I can't duplicate the problem on my systems either.
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 100 total points
ID: 39926038
Why a function call? You can use Replace directly in a query:

MyNewField: replace(replace(replace(data,"i",""), chr(13), ""), chr(10), " ")

Would give you a field in the query named MyNewField. Obviously  you'd need to replace "data" with the name of the Memo field.
0
 

Author Comment

by:jsgould
ID: 39926808
Scott:

This is a program that I am maintaining, not my development.

I'm wrestling with the issue that this works fine on XP systems, just an issue with Win7pro sytems, all using the same access version.
0
 

Author Comment

by:jsgould
ID: 39934902
update:
the whole process is create a hidden access report and convert it to pdf with ms add in. I have been looking at the pdf report and reporting above.

have removed the pdf conversion and dropped the hidden from the report. Now I'm looking at the report, same thing happens (if comments field empty, report field #Error) but the replace function mentioned above isn't used.
HTH
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39934947
maybe formatting property of field?
also, use NZ to handle nulls in query.
0
 

Author Comment

by:jsgould
ID: 39946128
coachman how would I do that?
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39946266
if you run the query by itself do you see errors?
if you use 'NZ(data,'')' instead of 'data' in the replace part does this fix it ? (I am assuming 'data' is the field you wish to manipulate)
* note the '' to the right of 'data,' is two single quotes, not one double.
0
 

Author Closing Comment

by:jsgould
ID: 39981821
excellent response, unfortunately issue not resolved yet. back to the drawing board.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2016 7 33
deduplicating based on criteria 2 19
Create report using crosstab query 11 27
Access Changing Number to Date with Seperator 5 20
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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.

815 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

9 Experts available now in Live!

Get 1:1 Help Now