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  

Change field value?



 
 
Thread Tools Display Modes
  #1  
Old May 19th, 2004, 09:17 PM
fredg
external usenet poster
 
Posts: n/a
Default Change field value?

On Sat, 22 May 2004 02:45:53 +0800, Gary wrote:

Hi,

I want to change a report field value, for example:
if the value include "/" , change like this
123/3=123
AS45328/12=AS45328
if not include "/", no change.

Thank for help!!

Gary


Add an unbound control to the report.
Set it's control source to:
=IIf(InStr([FieldName],"/"),left([FieldName],Instr([FieldName],"/")-1),[FieldName])

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #2  
Old May 19th, 2004, 10:06 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Change field value?

I wouldn't check for the existance of the "/". The lazy method would be to
use:
=Left([FieldName], InStr([FieldName] & "/","/") -1)

--
Duane Hookom
MS Access MVP
--

"fredg" wrote in message
...
On Sat, 22 May 2004 02:45:53 +0800, Gary wrote:

Hi,

I want to change a report field value, for example:
if the value include "/" , change like this
123/3=123
AS45328/12=AS45328
if not include "/", no change.

Thank for help!!

Gary


Add an unbound control to the report.
Set it's control source to:

=IIf(InStr([FieldName],"/"),left([FieldName],Instr([FieldName],"/")-1),[Fiel
dName])

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.



  #3  
Old May 20th, 2004, 04:36 PM
Gary
external usenet poster
 
Posts: n/a
Default Change field value?

Thank Fredg & Duane !!

"Duane Hookom" wrote in message
...
I wouldn't check for the existance of the "/". The lazy method would be to
use:
=Left([FieldName], InStr([FieldName] & "/","/") -1)

--
Duane Hookom
MS Access MVP
--

"fredg" wrote in message
...
On Sat, 22 May 2004 02:45:53 +0800, Gary wrote:

Hi,

I want to change a report field value, for example:
if the value include "/" , change like this
123/3=123
AS45328/12=AS45328
if not include "/", no change.

Thank for help!!

Gary


Add an unbound control to the report.
Set it's control source to:


=IIf(InStr([FieldName],"/"),left([FieldName],Instr([FieldName],"/")-1),[Fiel
dName])

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.





  #4  
Old May 21st, 2004, 07:45 PM
Gary
external usenet poster
 
Posts: n/a
Default Change field value?

Hi,

I want to change a report field value, for example:
if the value include "/" , change like this
123/3=123
AS45328/12=AS45328
if not include "/", no change.

Thank for help!!

Gary


 




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 12:37 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.