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  

ACC2000: Can't use Replace() in Control Source of report



 
 
Thread Tools Display Modes
  #1  
Old September 5th, 2007, 01:05 PM posted to microsoft.public.access.reports
A Man
external usenet poster
 
Posts: 29
Default ACC2000: Can't use Replace() in Control Source of report

Hi, I have a report in Access 2000. In a Control source of a text box I
have: =Trim(replace(UCase([LIST5]),"PER BOX","")).

Access does not recognize the replace function. Am I missing a reference
here? How do I fix this? LIST5 is my actual field and I want to remove
the string "PER BOX" from LIST5 if it exists.

Thanks.
  #2  
Old September 5th, 2007, 01:08 PM posted to microsoft.public.access.reports
Ken Snell \(MVP\)
external usenet poster
 
Posts: 2,506
Default ACC2000: Can't use Replace() in Control Source of report

Are you fully patched and updated for your 2000 ACCESS program? ACCESS 2000
did not recognize Replace function in queries and expressions until SP3, I
believe.

--

Ken Snell
MS ACCESS MVP


"A Man" wrote in message
. net...
Hi, I have a report in Access 2000. In a Control source of a text box I
have: =Trim(replace(UCase([LIST5]),"PER BOX","")).

Access does not recognize the replace function. Am I missing a reference
here? How do I fix this? LIST5 is my actual field and I want to remove
the string "PER BOX" from LIST5 if it exists.

Thanks.



  #3  
Old September 5th, 2007, 04:32 PM posted to microsoft.public.access.reports
Klatuu
external usenet poster
 
Posts: 7,074
Default ACC2000: Can't use Replace() in Control Source of report

A work around would be to create a function to do the replace and make the
function the control source:

Private Function FormatControl(varOriginal As Variant) As String
FormatControl = Trim(replace(UCase(Nz([LIST5], vbNullString)), _
"PER BOX", vbNullString))
End Function

Note using Variant in the function is in case there is a null value in the
field LIST5]
Also, change of "" to vbNullString. Using an intrinsic constant rather than
a literal is a performance enhancer.

Since the Replace is in a function it should work.
--
Dave Hargis, Microsoft Access MVP


"Ken Snell (MVP)" wrote:

Are you fully patched and updated for your 2000 ACCESS program? ACCESS 2000
did not recognize Replace function in queries and expressions until SP3, I
believe.

--

Ken Snell
MS ACCESS MVP


"A Man" wrote in message
. net...
Hi, I have a report in Access 2000. In a Control source of a text box I
have: =Trim(replace(UCase([LIST5]),"PER BOX","")).

Access does not recognize the replace function. Am I missing a reference
here? How do I fix this? LIST5 is my actual field and I want to remove
the string "PER BOX" from LIST5 if it exists.

Thanks.




 




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 03:38 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.